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()}
| backup_finish/1 | Release the resources held by the backup. |
| backup_init/4 | Initialize a backup procedure. |
| backup_pagecount/1 | Get the remaining number of pages which need to be backed up. |
| backup_remaining/1 | Get the remaining number of pages which need to be backed up. |
| backup_step/2 | Do a backup step. |
| bind/2 | Bind an array of values as parameters of a prepared statement. |
| bind_blob/3 | |
| bind_double/3 | |
| bind_int/3 | |
| bind_int64/3 | |
| bind_null/2 | |
| bind_text/3 | |
| changes/1 | Get the number of changes in the most recent INSERT, UPDATE or DELETE. |
| close/1 | Close the database. |
| column_decltypes/1 | Return the column types of the prepared statement. |
| column_names/1 | Return the column names of the prepared statement. |
| error_info/1 | Return a description of the last occurred error. |
| exec/2 | Compile a SQL statement. |
| fetchall/1 | Fetch all rows from the prepared statement. |
| get_autocommit/1 | Check if the connection is in auto-commit mode. |
| interrupt/1 | Interrupt a long running query. |
| last_insert_rowid/1 | Get the last inserted rowid. |
| open/1 | Opens a sqlite3 database mentioned in Filename. |
| prepare/2 | Compile a SQL statement. |
| prepare/3 | Compile a SQL statement. |
| q/2 | Execute a sql statement, returns the result as list rows. |
| q/3 | Execute statement, bind args and return a list rows. |
| reset/1 | Reset the prepared statement. |
| set_update_hook/2 | Subscribe to database notifications. |
| 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 | |
| step/1 |
backup_finish(Backup) -> Result
Release the resources held by the backup.
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.
backup_pagecount(Backup) -> Pagecount
Get the remaining number of pages which need to be backed up.
backup_remaining(Backup) -> Remaining
Get the remaining number of pages which need to be backed up.
backup_step(Esqlite3_backup::esqlite3_backup(), NPage::integer()) -> ok | '$done' | error()
Do a backup step.
bind(Statement, Args) -> Result
Bind an array of values as parameters of a prepared statement
bind_blob(Statement, Index, Value) -> BindResult
bind_double(Statement, Index, Value) -> BindResult
bind_int(Statement, Index, Value) -> BindResult
bind_int64(Statement, Index, Value) -> BindResult
bind_null(Statement, Index) -> BindResult
bind_text(Statement, Index, Value) -> BindResult
changes(Connection) -> ChangesResult
Get the number of changes in the most recent INSERT, UPDATE or DELETE. See https://sqlite.org/c3ref/changes.html for more details.
close(Connection) -> CloseResult
Close the database
column_decltypes(Statement) -> Types
Return the column types of the prepared statement.
column_names(Statement) -> Names
Return the column names of the prepared statement.
error_info(Connection) -> ErrorInfo
Return a description of the last occurred error.
exec(Connection, Sql) -> ExecResult
Compile a SQL statement. Returns a cached compiled statement which can be used in queries.
fetchall(Statement) -> Result
Fetch all rows from the prepared statement.
get_autocommit(Connection) -> AutocommitResult
Check if the connection is in auto-commit mode. See: https://sqlite.org/c3ref/get_autocommit.html for more details.
interrupt(Connection) -> Result
Interrupt a long running query. See https://sqlite.org/c3ref/interrupt.html for more details.
last_insert_rowid(Connection) -> RowidResult
Get the last inserted rowid. See https://sqlite.org/c3ref/set_last_insert_rowid.html for more details.
open(Filename) -> OpenResult
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.
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.
q(Connection, Sql) -> Result
Execute a sql statement, returns the result as list rows.
q(Connection, Sql, Args) -> Result
Execute statement, bind args and return a list rows.
reset(Statement) -> ResetResult
Reset the prepared statement.
set_update_hook(Connection, Pid) -> Result
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.
status() -> StatusInfo
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()
step(Statement) -> StepResult
Generated by EDoc