An amalgamated fork of Irene Knapp's direct-sqlite and Janne Hellsten's sqlite-simple.
-
Unlike direct-sqlite, it doesn't include the code for the C library, so you'll have to install the library separately.
Example of
cabal.project.local
pointing to local libs on Windows:package dani-sqlite extra-include-dirs: C:/Users/somefolder/sqlite-amalgamation-3350300 extra-lib-dirs: C:/Users/somefolder/sqlite-dll-win64-x64-3350300
-
Requires SQLite >= 3.37.0.
-
Supports
sqlite3_open_v2
. -
Supports extended result codes.
-
Unlike sqlite-simple, this library doesn't have a time type.
-
Unlike sqlite-simple, this library doesn't have a quasiquoter.
I see very little reason to not use CApiFFI if your project doesn't need to work on old GHCs.
-
Chapter 17. Interfacing with C: the FFI
the #const keyword hsc2hs provides [...] We can bind to the constants manually, by listing the CPP symbols for them using the #const keyword
-
Converting between
CInt
andInt
Does that mean that I should always use functions like fromIntegral to convert between CInt and Int/Integer?
-
While the Report isn't entirely clear on this, but my understanding is that the calling convention (e.g. ccall) in a foreign import ... "wrapper" indicates the calling convention that the resulting FunPtr should expect to be invoked with. If this is true then it's not obvious what foreign import capi "wrapper" should mean; afterall capi isn't really a calling convention. Rather, it just says "delegate code generation for the call to the C compiler". However, we can't delegate like this in for a "wrapper" import, since this would be akin to writing foreign export capi, which don't support.
-
Ideally, applications should finalize all prepared statements, close all BLOB handles, and finish all sqlite3_backup objects associated with the sqlite3 object prior to attempting to close the object.
- Irene Knapp and the rest of contributors to direct-sqlite.
- Janne Hellsten and the rest of contributors to sqlite-simple.