Liking cljdoc? Tell your friends :D

ebifriedrice.rsqlite.capi

Thin, idiomatic Clojure over the org.sqlite.jni C-style binding.

This is the only namespace that touches the JNI classes (besides natives' loader), so upstream's experimental-API churn stays behind one seam. Everything here maps one C call to one Clojure function, converts values per column type, and turns non-OK result codes into ex-info carrying sqlite3_errmsg - the C layer never throws on its own.

Resource discipline follows the binding's golden rule: statements are finalized (with-stmt) and databases closed (close!) explicitly; the GC never frees native resources.

Thin, idiomatic Clojure over the org.sqlite.jni C-style binding.

This is the only namespace that touches the JNI classes (besides
natives' loader), so upstream's experimental-API churn stays behind
one seam. Everything here maps one C call to one Clojure function,
converts values per column type, and turns non-OK result codes
into ex-info carrying sqlite3_errmsg - the C layer never throws on
its own.

Resource discipline follows the binding's golden rule: statements
are finalized (with-stmt) and databases closed (close!)
explicitly; the GC never frees native resources.
raw docstring

autocommit?clj

(autocommit? db)
source

bind-all!clj

(bind-all! stmt params)

Bind positional parameters left to right, 1-based.

Bind positional parameters left to right, 1-based.
sourceraw docstring

close!clj

(close! db)
source

column-namesclj

(column-names db table)

Declared column names of a table, from a zero-row select - the engine's column-name cache for translating positional preupdate values into names.

Declared column names of a table, from a zero-row select - the
engine's column-name cache for translating positional preupdate
values into names.
sourceraw docstring

eqp-tablesclj

(eqp-tables db sql)

Normalised table set the planner reports reading - sqldeps' sound floor. Runs unbound: the plan does not depend on parameter values.

Normalised table set the planner reports reading - sqldeps' sound
floor. Runs unbound: the plan does not depend on parameter values.
sourceraw docstring

exec!clj

(exec! db sql)
(exec! db sql params)

Run one write statement (no result rows expected). Exactly one statement: multi-statement strings are rejected by the engine above this layer.

Run one write statement (no result rows expected). Exactly one
statement: multi-statement strings are rejected by the engine
above this layer.
sourceraw docstring

finalize!clj

(finalize! stmt)
source

openclj

(open)
(open uri)

Open a database; no argument means in-memory. URIs need no flags - SQLITE_OPEN_URI is always set, matching how users expect file:...?mode=memory&cache=shared spellings to behave.

Open a database; no argument means in-memory. URIs need no flags -
SQLITE_OPEN_URI is always set, matching how users expect
file:...?mode=memory&cache=shared spellings to behave.
sourceraw docstring

prepareclj

(prepare db sql)

Compile one statement. Whitespace-only SQL is an error, not a nil statement - callers always want a real statement or an exception.

Compile one statement. Whitespace-only SQL is an error, not a nil
statement - callers always want a real statement or an exception.
sourceraw docstring

query-allclj

(query-all db sql)
(query-all db sql params)

Run one statement, realizing all rows as maps keyed by column name in declaration order.

Run one statement, realizing all rows as maps keyed by column
name in declaration order.
sourceraw docstring

reset!clj

(reset! stmt)
source

run-stmt!clj

(run-stmt! stmt params)

Bind, run to completion and reset a prepared statement for reuse - the engine's recompute path over cached statements.

Bind, run to completion and reset a prepared statement for reuse -
the engine's recompute path over cached statements.
sourceraw docstring

step-allclj

(step-all stmt)

Step a bound statement to completion; returns nothing. The engine's write path - queries use query-all.

Step a bound statement to completion; returns nothing. The engine's
write path - queries use query-all.
sourceraw docstring

value->cljclj

(value->clj v)

One sqlite3_value to a Clojure value, per its type code. Must run while the value is alive - inside a preupdate callback.

One sqlite3_value to a Clojure value, per its type code. Must run
while the value is alive - inside a preupdate callback.
sourceraw docstring

with-dbcljmacro

(with-db [db db-or-uri] & body)

Evaluate body with a database - an open handle passed through, a URI string opened - closed afterwards when we opened it.

Evaluate body with a database - an open handle passed through, a
URI string opened - closed afterwards when we opened it.
sourceraw docstring

with-stmtcljmacro

(with-stmt [stmt prepare-expr] & body)

Evaluate body with a compiled statement, finalized afterwards.

Evaluate body with a compiled statement, finalized afterwards.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close