initial commit
This commit is contained in:
48
README.md
Normal file
48
README.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# tsqlite
|
||||
A wrapper for [sqlite](https://sqlite.org) that uses [tlibc](https://timerix.ddns.net/git/Timerix/tlibc) for error handling.
|
||||
|
||||
## Build
|
||||
1. Clone this repository.
|
||||
```
|
||||
git clone https://timerix.ddns.net/git/Timerix/tsqlite.git
|
||||
```
|
||||
|
||||
2. Install [cbuild](https://timerix.ddns.net/git/Timerix/cbuild/releases).
|
||||
Select latest version compatible with the one in `project.config`.
|
||||
Example: For `2.3.0` download latest `2.3.x`.
|
||||
|
||||
3. Clone [tlibc](https://timerix.ddns.net/git/Timerix/tlibc).
|
||||
By default `dependencies/tlibc.config` expects that `tlibc/` is present in the same directory as `tsqlite/`.
|
||||
If you cloned it to another directory, change `DEPENDENCIES_DIR` in `tsqlite/project.user.config`.
|
||||
```
|
||||
git clone https://timerix.ddns.net/git/Timerix/tlibc.git
|
||||
```
|
||||
|
||||
4. Install **sqlite** library.
|
||||
MinGW: `pacman -S mingw-w64-x86_64-sqlite3`
|
||||
|
||||
5. Build and run tests
|
||||
```
|
||||
cd tsqlite
|
||||
cbuild build_exec exec
|
||||
```
|
||||
|
||||
6. To build library use tasks `build_static_lib[_dbg]` or `build_shared_lib[_dbg]`
|
||||
|
||||
|
||||
## Usage
|
||||
```c
|
||||
#include "tsqlite.h"
|
||||
|
||||
int main(){
|
||||
Deferral(32); // reserve memory for 32 defers
|
||||
// init tlibc global variables
|
||||
try_fatal_void(tlibc_init());
|
||||
// init tsqlite global variables
|
||||
try_fatal_void(tsqlite_init());
|
||||
Defer(tlibc_deinit());
|
||||
Defer(tsqlite_deinit());
|
||||
|
||||
Return 0; // call defers
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user