Copyright © 2011 - 2022 Maas-Maarten Zeeman
Authors: Maas-Maarten Zeeman (mmzeeman@xs4all.nl).
cell() = esqlite3_nif:cell()
error() = esqlite3_nif:error()
esqlite3() = #esqlite3{db = esqlite3_nif:esqlite3_ref()}
esqlite3_backup() = #esqlite3_backup{backup = esqlite3_nif:esqlite3_backup_ref()}
esqlite3_stmt() = #esqlite3_stmt{stmt = esqlite3_nif:esqlite3_stmt_ref()}
prepare_flags() = persistent | no_vtab
row() = esqlite3_nif:row()
rowid() = esqlite3_nif:rowid()
sql() = esqlite3_nif:sql()
stats() = #{used := non_neg_integer(), highwater := non_neg_integer()}
status_info() = #{memory_used => stats(), pagecache_used => stats(), pagecache_overflow => stats(), malloc_size := stats(), parser_stack := stats(), pagecache_size := stats(), malloc_count := stats()}
open/1 | Opens a sqlite3 database mentioned in Filename. |
close/1 | Close the database. |
error_info/1 | Return a description of the last occurred error. |
interrupt/1 | Interrupt a long running query. |
set_update_hook/2 | Subscribe to database notifications. |
q/2 | Execute a sql statement, returns the result as list rows. |
q/3 | Execute statement, bind args and return a list rows. |
fetchall/1 | Fetch all rows from the prepared statement. |
last_insert_rowid/1 | Get the last inserted rowid. |
changes/1 | Get the number of changes in the most recent INSERT, UPDATE or DELETE. |
get_autocommit/1 | Check if the connection is in auto-commit mode. |
exec/2 | Compile a SQL statement. |
prepare/2 | Compile a SQL statement. |
prepare/3 | Compile a SQL statement. |
bind/2 | Bind an array of values as parameters of a prepared statement. |
bind_int/3 | |
bind_int64/3 | |
bind_double/3 | |
bind_text/3 | |
bind_blob/3 | |
bind_null/2 | |
step/1 | |
reset/1 | Reset the prepared statement. |
column_names/1 | Return the column names of the prepared statement. |
column_decltypes/1 | Return the column types of the prepared statement. |
backup_init/4 | Initialize a backup procedure. |
backup_finish/1 | Release the resources held by the backup. |
backup_step/2 | Do a backup step. |
backup_remaining/1 | Get the remaining number of pages which need to be backed up. |
backup_pagecount/1 | Get the remaining number of pages which need to be backed up. |
status/0 | Get all internal status information from sqlite. |
status/1 | Specify which internal status information you need, when true
is passed, the highwater information from the status information
will be reset. |
status/2 |
Opens a sqlite3 database mentioned in Filename.
The standard supplied sqlite3 library supports uri filenames, which makes it possible to open the connection to the database in read-only mode. More information about this can be found here: https://sqlite.org/uri.html
Example:
open("file:data.db")Opens "data.db" in the current working directory
open("file:data.db?mode=ro&cache=private")Opens "data.db" in read only mode with a private cache
open("file:memdb1?mode=memory&cache=shared")Opens a shared memory database named memdb1 with a shared cache.
Close the database
Return a description of the last occurred error.
Interrupt a long running query. See https://sqlite.org/c3ref/interrupt.html for more details.
Subscribe to database notifications. When rows are inserted deleted or updates, the registered process will receive messages:
{insert, binary(), binary(), rowid()}When a new row has been inserted.
{delete, binary(), binary(), rowid()}When a new row has been deleted.
{update, binary(), binary(), rowid()}When a row has been updated.
Execute a sql statement, returns the result as list rows.
q(Connection, Sql, Args) -> Result
Execute statement, bind args and return a list rows.
Fetch all rows from the prepared statement.
Get the last inserted rowid. See https://sqlite.org/c3ref/set_last_insert_rowid.html for more details.
Get the number of changes in the most recent INSERT, UPDATE or DELETE. See https://sqlite.org/c3ref/changes.html for more details.
get_autocommit(Connection) -> AutocommitResult
Check if the connection is in auto-commit mode. See: https://sqlite.org/c3ref/get_autocommit.html for more details.
Compile a SQL statement. Returns a cached compiled statement which can be used in queries.
prepare(Connection, Sql) -> PrepareResult
Compile a SQL statement. Returns a cached compiled statement which can be used in queries.
prepare(Connection, Sql, PrepareFlags) -> PrepareResult
Compile a SQL statement. Returns a cached compiled statement which can be used in queries.
bind(Statement, Args) -> Result
Bind an array of values as parameters of a prepared statement
bind_int(Statement, Index, Value) -> BindResult
bind_int64(Statement, Index, Value) -> BindResult
bind_double(Statement, Index, Value) -> BindResult
bind_text(Statement, Index, Value) -> BindResult
bind_blob(Statement, Index, Value) -> BindResult
bind_null(Statement, Index) -> BindResult
Reset the prepared statement.
Return the column names of the prepared statement.
Return the column types of the prepared statement.
backup_init(Esqlite3::esqlite3(), DestName::iodata(), X3::esqlite3(), SrcName::iodata()) -> {ok, esqlite3_backup()} | {error, term()}
Initialize a backup procedure. See https://sqlite.org/backup.html for more details on the backup api.
Release the resources held by the backup.
backup_step(Esqlite3_backup::esqlite3_backup(), NPage::integer()) -> ok | '$done' | error()
Do a backup step.
Get the remaining number of pages which need to be backed up.
Get the remaining number of pages which need to be backed up.
Get all internal status information from sqlite.
status(ArgsOrResetHighWater) -> Status
Specify which internal status information you need, when true
is passed, the highwater
information from the status information
will be reset.
status(Args, ResetHighWater) -> any()
Generated by EDoc