Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== sqlite3pth == Overview * Run SQLite queries asynchronously in pthreads. Supports calling Scheme from SQLite's VFS to supply database block storage. * Offloads the SQL work to pthreads; the chicken thread is free to continue. * VFS support allows sqlite3 to call back into chicken to supply blocks of the data base. (This is a breakout from ball.askemos.org - where the VFS is used to implement versioning and replication of the databases.) * Safe to be used with CHICKEN's srfi-18 threads. (I.e., does {{NOT}} use {{define-external}}.) == Requirements [[sql-null]], [[pthreads]], [[srfi-18]], [[srfi-34]], [[llrb-tree]], [[miscmacros]], [[srfi-1]] == API <procedure>(: sql-index (:sql-result: string --> (or false fixnum)))</procedure> convert field name to index <procedure>(: sqlite3-prepare ((struct <sqlite3-database>) string --> (struct <sqlite3-statement>)))</procedure> Prepare query. <procedure>(: sqlite3-exec ((struct <sqlite3-database>) (or string (struct <sqlite3-statement>)) #!rest -> :sql-result:))</procedure> Execute statement or prepared query. <procedure>(: sqlite3-call-with-transaction ((struct <sqlite3-database>) (procedure ((procedure (string #!rest) :sql-result:)) :sql-result:) -> :sql-result:))</procedure> Call procedure in a sqlite transaction. <procedure>sqlite3-call-test/set</procedure> questionable, undocumented <procedure>(: sqlite3-close ((struct <sqlite3-database>) -> . *))</procedure> Close database. <procedure>sqlite3-interrupt!</procedure> Call sqlite_interrupt to abort running query. <procedure>sql-result?</procedure> Test predicate for the sql result type. <procedure>(sql-value RESULT ROW FIELD) --> *</procedure> Result Accessor. <procedure>(: sql-ref (:sql-result: (or boolean fixnum) (or boolean fixnum string symbol) --> *))</procedure> <procedure>(: sql-fold (:sql-result: (procedure ((procedure (fixnum) *) *) *) * -> *))</procedure> Fold procedure over results. <procedure>sqlite3-open</procedure> <procedure>sqlite3-close</procedure> <procedure>(: sqlite3-open-restricted (string #!optional string vector --> (struct <sqlite3-database>)))</procedure> Restricted open optionally with VFS. SQL may not attach other files. optional string requests sqlite3 VFS, vector holds VFS callbacks <procedure>(: sqlite3-open-restricted-ro (string #!optional string vector --> (struct <sqlite3-database>)))</procedure> Restricted open read only optionally with VFS. SQL may not attach other files. optional string requests sqlite3 VFS, vector holds VFS callbacks === Accessors sqlite3-database-name sqlite3-changes sqlite3-statement? sqlite3-statement-name sqlite3-error? sqlite3-error-code sqlite3-error-args <procedure>sqlite3-error-db-locked?</procedure> === debug aid <procedure>(sqlite3-debug-statements FLAG)</procedure> Log queries. == VFS Interface The VFS allows to call back to Chicken when sqlite need to read data. This is currently only lightly documented in [[https://github.com/0-8-15/sqlite3pth/blob/master/tests/run.scm|tests/run.scm]]. == Examples (define db (sqlite-open "path")) (sqlite3-exec db "select 1") ; 1 (sqlite3-exec db (sqlite3-prepare db "select ?1") 1) ; 1 == About this egg === Source Code Currently [[https://github.com/0-8-15/sqlite3pth/|maintained here]] at github. === Author Jörg F. Wittenberger === License BSD
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 2 from 6?