Module esqlcipher_nif

Low level erlang API for sqlite3 databases.

Copyright © 2011 - 2017 Maas-Maarten Zeeman

Authors: Maas-Maarten Zeeman (mmzeeman@xs4all.nl).

Description

Low level erlang API for sqlite3 databases

Function Index

bind/5Bind parameters to a prepared statement.
changes/3Get the number of affected rows of last statement.
close/3Close the connection.
column_names/4Retrieve the column names of the prepared statement.
column_types/4Retrieve the column types of the prepared statement.
exec/4Exec the query.
finalize/4.
get_autocommit/3Get automcommit.
insert/4Insert record.
key/4Give the encryption key for a specified sqlite3 database.
multi_step/5.
open/4Open the specified sqlite3 database.
prepare/4.
rekey/4Change the encryption key for a specified sqlite3 database.
reset/4.
set_update_hook/4
start/0Start a low level thread which will can handle sqlite3 calls.

Function Details

bind/5

bind(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid(), Args::[]) -> ok | {error, message()}

Bind parameters to a prepared statement.

changes/3

changes(Db, Ref, Dest) -> any()

Get the number of affected rows of last statement

When the statement is executed Dest will receive message {Ref, answer()} with answer() integer | {error, reason()}

close/3

close(Db::connection(), Ref::reference(), Dest::pid()) -> ok | {error, message()}

Close the connection.

column_names/4

column_names(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid()) -> {ok, tuple()} | {error, message()}

Retrieve the column names of the prepared statement

column_types/4

column_types(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid()) -> {ok, tuple()} | {error, message()}

Retrieve the column types of the prepared statement

exec/4

exec(Db::connection(), Ref::reference(), Dest::pid(), Sql::string()) -> ok | {error, message()}

Exec the query.

Sends an asynchronous exec command over the connection and returns ok immediately.

When the statement is executed Dest will receive message {Ref, answer()} with answer() integer | {error, reason()}

finalize/4

finalize(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid()) -> ok | {error, message()}

get_autocommit/3

get_autocommit(Db::connection(), Ref::reference(), Dest::pid()) -> true | false

Get automcommit

insert/4

insert(Db::connection(), Ref::reference(), Dest::pid(), Sql::string()) -> {ok, integer()} | {error, message()}

Insert record

key/4

key(Db::connection(), Ref::reference(), Dest::pid(), Key::string()) -> ok | {error, message()}

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!

multi_step/5

multi_step(Db::connection(), Stmt::statement(), Chunk_Size::pos_integer(), Ref::reference(), Dest::pid()) -> {term(), [tuple]} | {error, message()}

open/4

open(Db::connection(), Ref::reference(), Dest::pid(), Filename::string()) -> ok | {error, message()}

Open the specified sqlite3 database.

Sends an asynchronous open command over the connection and returns ok immediately. When the database is opened

prepare/4

prepare(Db::connection(), Ref::reference(), Dest::pid(), Sql::string()) -> ok | {error, message()}

rekey/4

rekey(Db::connection(), Ref::reference(), Dest::pid(), Key::string()) -> ok | {error, message()}

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

reset/4

reset(Db::connection(), Stmt::statement(), Ref::reference(), Dest::pid()) -> ok | {error, message()}

set_update_hook/4

set_update_hook(Db, Ref, Dest, Pid) -> any()

start/0

start() -> {ok, connection()} | {error, msg()}

Start a low level thread which will can handle sqlite3 calls.


Generated by EDoc