@sqlite module contains a single class
@db, which represents a
Note that the version of SQLite compiled into Axiom is 3.8.9, and has the following extensions enabled:
Create or open a SQLite database at path.
db = sqlite.db('data.db') print db.schema() #print the schema print db.query('SELECT * FROM entries WHERE rowid = ?',) #print row with rowid=2
Query the database.
SQLite uses '?' as placeholder to bind arguments to query statements.
Turn headers on or off in query results.
Headers are off by default. Headers only appear if there are 1 or more rows in the result. If there are 0 rows in the result, headers will not appear even if headers are on.
Commit changes to the database.
This will block until the commit actually happens (unlike Python, which fails if the database is locked and forces you to retry repeatedly).
The the rowid of the last inserted row.
Every row in every table in SQLite has a implicit nonzero integer autoincrement field called 'rowid', which can be used to uniquely identify a row within a table.
Get all tables matching glob.
Get the version of SQLite used.
The latest version being used by Axiom is SQLite "3.8.9 2015-04-08 12:16:33 8a8ffc862e96f57aa698f93de10dee28e69f6e09".
Get the schema of the database.
Subsequent modifications ('ALTER TABLE...') are reflected within the schema.
Get just the indices within the database.
Evaluate a line like the SQLite CLI (command-line interface) does.
This is meant to be used within a REPL (read-evaluate-print loop). The parameter line can be either SQL or one of the following commands:
This imitates the behavior of the official SQLite CLI.