(Created by gh-md-toc)
The idea is to minimize boilerplate code when doing the same things using native SQLite API. Only recurring usages are wrapped into helper classes or plain functions. Mixed uses of this module and the native API are expected. Always prefer bux::C_SQLite, bux::C_SQLiteStmt over sqlite3*, sqlite3_stmt* and you will be fine.
| Original Type | Wrapper Class |
|---|---|
sqlite3* |
bux::C_SQLite |
sqlite3_stmt* |
bux::C_SQLiteStmt |
- The right colum (class type) of each row above can be cast to the left column (native SQLite pointer type) implicitly & safely.
bux::C_SQLitecan only be constructed by a valid SQLite databse file name.bux::C_SQLiteStmtis contructed by passing abux::C_SQLiteinstance and a SQL statement. And it is the recommended way to bind SQL arguments by calling nativesqlite3_bind_\w+()functions before its ownexecute()method.
in ArchLinux
-
Make sure you have installed
yayor any other pacman wrapper. -
yay -S bux-sqliteto install.buxis also installed with it. -
yay -Ql bux-sqliteto see the installed files:bux-sqlite /usr/ bux-sqlite /usr/include/ bux-sqlite /usr/include/bux/ bux-sqlite /usr/include/bux/oo_sqlite.h bux-sqlite /usr/lib/ bux-sqlite /usr/lib/libbux-sqlite.a bux-sqlite /usr/share/ bux-sqlite /usr/share/licenses/ bux-sqlite /usr/share/licenses/bux-sqlite/ bux-sqlite /usr/share/licenses/bux-sqlite/LICENSE
-
Include the sole header file by prefixing the header name with
bux/:#include <bux/oo_sqlite.h>
p.s. Compiler is expected to search
/usr/includeby default. -
Make sure
buxis also installed. -
If directly using
gccorclangis intended, the required compiler flags are-lbux-sqlite -lbux
from github in any of Linux distros
-
Make sure you have installed
cmakemakegccgitsqlite, or the likes. Known package names in different distros/package-managers:Distro/PkgMngr Package Name ArchLinux/yay sqliteFedora/dnf sqlite-devel -
git clone https://github.com/buck-yeh/bux-sqlite.git cd bux-sqlite cmake -D FETCH_DEPENDEES=1 -D DEPENDEE_ROOT=_deps . make -j
-
Make sure
buxis also installed or built. -
Include
include/bux/oo_sqlite.hand link withsrc/libbux-sqlite.a&whereever-you-install-or-build-it/libbux.a