Atom

sqlite.query()

Executes a statement and materializes rows.

Signature

sqlite.query(connection, statement[, parameters])

Parameters

Connection, SQL string, optional positional parameter array.

Returns

Array of dictionaries keyed by SQL result column name. SQL values map to null, i64, f64, string or packed BLOB.

Behavior

Duplicate column names overwrite earlier ones in the row. Use SQL aliases for distinct keys. A query can also mutate the database if its SQL does.

Errors

Statement/parameter error, invalid UTF-8 text result or closed connection.

Example

Atom
use sqlite
db = sqlite.open()
assert(sqlite.query(db, 'select ? as title', ['Atom'])[0].title == 'Atom')
sqlite.close(db)