Skip to content
Bindings to sqlite for the Janet language.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
build.janet
main.c
sqlite3.c
sqlite3.h
test.janet

README.md

SQLite bindings

This native module proves sqlite bindings for janet.

Building

To build, use the build.janet script and make sure you have janet installed.

janet build.janet

Example Usage

Next, enter the repl and create a database and a table. By default, the generated module will be in the build folder.

janet:1:> (import build/sqlite3 :as sql)
nil
janet:2:> (def db (sql/open "test.db"))
<sqlite3.connection 0x5561A138C470>
janet:3:> (sql/eval db `CREATE TABLE customers(id INTEGER PRIMARY KEY, name TEXT);`)
@[]
janet:4:> (sql/eval db `INSERT INTO customers VALUES(:id, :name);` {:name "John" :id 12345})
@[]
janet:5:> (sql/eval db `SELECT * FROM customers;`)
@[{"id" 12345 "name" "John"}]

Finally, close the database connection when done with it.

janet:6:> (sql/close db)
nil
You can’t perform that action at this time.