https://www.sqlite.org/c3ref/open.html
This sets the 'Ptr CDatabase' even on failure.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Moduledirect-sqlite-2.3.29Haskell2010
https://www.sqlite.org/c3ref/open.html
This sets the 'Ptr CDatabase' even on failure.
https://www.sqlite.org/c3ref/open.html
This sets the 'Ptr CDatabase' even on failure.
c_sqlite3_trace c_sqlite3_exec A couple important things to know about callbacks from Haskell code:
If the callback throws an exception, apparently, the whole program is terminated.
Remember to call freeHaskellFunPtr when you are done with the wrapper, to avoid leaking memory.
c_sqlite3_prepare_v2 :: Ptr CDatabase-> CStringSQL statement, UTF-8 encoded.
-> CNumBytesMaximum length of the SQL statement, in bytes. If this is negative, then the SQL statement is treated as a NUL-terminated string.
-> Ptr (Ptr CStatement)OUT: Statement handle. This must not be null.
-> Ptr CStringOUT: Pointer to unused portion of zSql.
-> IO CErrorhttps://www.sqlite.org/c3ref/prepare.html
If the query contains no SQL statements, this returns SQLITE_OK and sets
the Ptr CStatement to null.
https://www.sqlite.org/c3ref/reset.html
Warning: If the most recent c_sqlite3_step call failed, this will return the corresponding error code.
https://www.sqlite.org/c3ref/finalize.html
Warning: If the most recent c_sqlite3_step call failed, this will return the corresponding error code.
https://www.sqlite.org/c3ref/clear_bindings.html
A look at the source reveals that this function always returns SQLITE_OK.
https://www.sqlite.org/c3ref/bind_parameter_count.html
This returns the index of the largest (rightmost) parameter, which is not
necessarily the number of parameters. If numbered parameters like ?5
are used, there may be gaps in the list.
c_sqlite3_bind_blob :: Ptr CStatement-> CParamIndexIndex of the SQL parameter to be set
-> Ptr aValue to bind to the parameter.
Warning: If this pointer is NULL, this
will bind a null value, rather than an empty blob.
-> CNumBytesLength, in bytes. This must not be negative.
-> Ptr CDestructor-> IO CErrorc_sqlite3_bind_text :: Ptr CStatement-> CParamIndex-> CStringWarning: If this pointer is NULL, this
will bind a null value, rather than an empty text.
-> CNumBytesLength, in bytes. If this is negative, the value is treated as a NUL-terminated string.
-> Ptr CDestructor-> IO CErrorc_sqlite3_blob_open