Copyright © 2011 - 2021 Maas-Maarten Zeeman, Felix Kiunke
Version: 2.0.0-rc.3
Authors: Maas-Maarten Zeeman (mmzeeman@xs4all.nl), Felix Kiunke (dev@fkiunke.de).
start/0
. These functions are implemented in native C.
All functions return immediately; results are sent as a message when ready.
bind_value() = sql_value() | {pos_integer() | atom(), sql_value()}
List of values for statement parameters (see bind/3
).
connection() = reference()
sql() = iodata()
SQL string type.
sql_value() = number() | nil | iodata() | {'$blob', iodata()}
SQL value type.
statement() = reference()
bind/5 | Bind parameters to a prepared statement. |
changes/3 | Get the number of rows affected by the last update, insert, or delete statement. |
close/3 | Close the sqlite3 connection. |
column_names/4 | Retrieve the column names of the prepared statement. |
column_types/4 | Retrieve the column types of the prepared statement. |
exec/4 | Execute a query without returning any resulting rows. |
get_autocommit/3 | Returns whether or not the database is in autocommit mode. |
insert/4 | Execute a query, returning the last inserted row's rowid. |
key/4 | Give the encryption key for a specified sqlite3 database. |
multi_step/5 | Run sqlite3's step multiple times to get chunks of rows. |
open/4 | Open the specified sqlite3 database. |
prepare/4 | Create a prepared statement. |
rekey/4 | Change the encryption key for a specified sqlite3 database. |
reset/5 | Resets a prepared statement to its initial state, optionally clearing bound values. |
set_update_hook/4 | Set an update hook that will be called for any database changes. |
start/0 | Start a low level thread which can handle sqlite3 calls. |
bind(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid(), Args::[bind_value()]) -> ok
Bind parameters to a prepared statement.
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:bind/3.
changes(Db::connection(), Ref::reference(), Dest::pid()) -> ok
Get the number of rows affected by the last update, insert, or delete statement.
Returns a message of the format
{ok, integer()} | sqlite_error()
See also: esqlcipher:changes/2.
close(Db::connection(), Ref::reference(), Dest::pid()) -> ok
Close the sqlite3 connection.
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:close/2.
column_names(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid()) -> ok
Retrieve the column names of the prepared statement.
Returns a message of the format
{ok, [binary()]} | sqlite_error()
See also: esqlcipher:column_names/2.
column_types(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid()) -> ok
Retrieve the column types of the prepared statement
Returns a message of the format
{ok, [binary()]} | sqlite_error()
See also: esqlcipher:column_types/2.
exec(Db::connection(), Ref::reference(), Dest::pid(), Sql::sql()) -> ok
Execute a query without returning any resulting rows.
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:exec/3.
get_autocommit(Db::connection(), Ref::reference(), Dest::pid()) -> ok
Returns whether or not the database is in autocommit mode.
Returns a message of the format
boolean()
See also: esqlcipher:get_autocommit/2.
insert(Db::connection(), Ref::reference(), Dest::pid(), Sql::sql()) -> ok
Execute a query, returning the last inserted row's rowid.
Returns a message of the format
{ok, integer()} | sqlite_error()
See also: esqlcipher:insert/3.
key(Db::connection(), Ref::reference(), Dest::pid(), Key::iodata()) -> ok
Give the encryption key for a specified sqlite3 database. Note that there will be no error if the key is wrong -- try accessing the database and look for a NOTADB error to check for that!
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:open_encrypted/3.
multi_step(Db::connection(), Stmt::statement(), Chunk_Size::pos_integer(), Ref::reference(), Dest::pid()) -> ok
Run sqlite3's step
multiple times to get chunks of rows.
Called internally by esqlcipher:fetch_one/2
,
esqlcipher:fetch_chunk/3
, esqlcipher:fetch_all/3
and others.
Returns a message of the format
{rows | '$done' | '$busy', [row()]} | sqlite_error()
where row() is a list of values
open(Db::connection(), Ref::reference(), Dest::pid(), Filename::iodata()) -> ok
Open the specified sqlite3 database.
Sends an asynchronous open command over the connection and returns ok
immediately.
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:open/2, esqlcipher:open_encrypted/3.
prepare(Db::connection(), Ref::reference(), Dest::pid(), Sql::sql()) -> ok
Create a prepared statement
Returns a message of the format
{ok} | sqlite_error()
See also: esqlcipher:prepare/3.
rekey(Db::connection(), Ref::reference(), Dest::pid(), Key::iodata()) -> ok
Change the encryption key for a specified sqlite3 database. Note that this will only work once the database is decrypted, i.e. key/4 has been called. On unencrypted databases, it will silently fail/do nothing.
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:rekey/3.
reset(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid(), ClearValues::boolean()) -> ok
Resets a prepared statement to its initial state, optionally clearing bound values.
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:reset/3.
set_update_hook(Db::connection(), Ref::reference(), Dest::pid(), Pid::pid()) -> ok
Set an update hook that will be called for any database changes.
Returns a message of the format
ok | sqlite_error()
See also: esqlcipher:set_update_hook/3.
start() -> {ok, reference()}
Start a low level thread which can handle sqlite3 calls.
See also: esqlcipher:open/2, esqlcipher:open_encrypted/3.
Generated by EDoc