Liking cljdoc? Tell your friends :D

ebifriedrice.rsqlite.backend

The seam between the pure engine and a concrete SQLite binding.

The engine (registry, invalidation, recomputation) is pure cljc logic over this protocol; every platform provides one implementation over its native binding - org.sqlite.jni on the JVM, sqlite-wasm's capi in ClojureScript. Handles are opaque: prepared statements especially are binding-specific objects the engine only ever passes back.

Method map, with the contract the engine relies on:

-exec! run one statement for effect -prepare compile one statement, reused for every recompute -run-query bind + step a prepared statement to completion and reset it for reuse; returns rows as maps -finalize! release a prepared statement -subscribe! deliver raw preupdate events (preupdate.clj's shape) and rollback notifications -column-names declared columns of a table (a zero-row select) -eqp-tables the planner's table set for a statement -autocommit? whether no transaction is open -close! close the connection; per-db hooks are cleaned up raw-connection the native handle (sqlite3 on the JVM), for statement layers layered on top - nil where meaningless (wasm)

The seam between the pure engine and a concrete SQLite binding.

The engine (registry, invalidation, recomputation) is pure cljc
logic over this protocol; every platform provides one
implementation over its native binding - org.sqlite.jni on the
JVM, sqlite-wasm's capi in ClojureScript. Handles are opaque:
prepared statements especially are binding-specific objects the
engine only ever passes back.

Method map, with the contract the engine relies on:

-exec!        run one statement for effect
-prepare      compile one statement, reused for every recompute
-run-query    bind + step a prepared statement to completion and
              reset it for reuse; returns rows as maps
-finalize!    release a prepared statement
-subscribe!   deliver raw preupdate events (preupdate.clj's shape)
              and rollback notifications
-column-names declared columns of a table (a zero-row select)
-eqp-tables   the planner's table set for a statement
-autocommit?  whether no transaction is open
-close!       close the connection; per-db hooks are cleaned up
raw-connection the native handle (sqlite3 on the JVM), for
statement layers layered on top - nil where meaningless (wasm)
raw docstring

SqliteBackendclj/sprotocol

run-stmtclj/s

(run-stmt b stmt params)

subscribe!clj/s

(subscribe! b on-raw-event on-rollback)

finalize-stmtclj/s

(finalize-stmt b stmt)

prepare-stmtclj/s

(prepare-stmt b sql)

raw-connectionclj/s

(raw-connection b)

autocommit?clj/s

(autocommit? b)

close-backend!clj/s

(close-backend! b)

eqp-tablesclj/s

(eqp-tables b sql)

column-namesclj/s

(column-names b table)

exec-stmt!clj/s

(exec-stmt! b sql params)
source

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