Module esqlite3_nif

Low level erlang API for sqlite3 databases.

Copyright © 2011 - 2022 Maas-Maarten Zeeman

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

Description

Low level erlang API for sqlite3 databases.

Data Types

raw_backup()

raw_backup() = reference()

raw_connection()

raw_connection() = reference()

raw_statement()

raw_statement() = reference()

sql()

sql() = iodata()

Function Index

start/0Start a low level thread which will can handle sqlite3 calls.
open/4Open the specified sqlite3 database.
set_update_hook/4
exec/4Exec the query.
changes/3Get the number of affected rows of last statement.
prepare/4.
multi_step/5.
reset/4.
finalize/4.
bind/5Bind parameters to a prepared statement.
column_names/4Retrieve the column names of the prepared statement.
column_types/4Retrieve the column types of the prepared statement.
backup_init/6Initialize a backup procedure of a database.
backup_step/5Do a backup step.
backup_remaining/4Get the amount of remaining pages which need to be backed up.
backup_pagecount/4Get the total number of pages which need to be backed up.
backup_finish/4Finish the backup.
interrupt/1Interrupt all active queries.
close/3Close the connection.
insert/4Insert record.
last_insert_rowid/3Get the last insert rowid.
get_autocommit/3Get automcommit.

Function Details

start/0

start() -> {ok, raw_connection()} | {error, term()}

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

open/4

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

Open the specified sqlite3 database.

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

set_update_hook/4

set_update_hook(Db::raw_connection(), Ref::reference(), Dest::pid(), Pid::pid()) -> ok | {error, term()}

exec/4

exec(Db::raw_connection(), Ref::reference(), Dest::pid(), Sql::sql()) -> ok | {error, term()}

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()}

changes/3

changes(Db::raw_connection(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

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()}

prepare/4

prepare(Db::raw_connection(), Ref::reference(), Dest::pid(), Sql::sql()) -> ok | {error, term()}

multi_step/5

multi_step(Db::raw_connection(), Stmt::raw_statement(), Chunk_Size::pos_integer(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

reset/4

reset(Db::raw_connection(), Stmt::raw_statement(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

finalize/4

finalize(Db::raw_connection(), Stmt::raw_statement(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

bind/5

bind(Db::raw_connection(), Stmt::raw_statement(), Ref::reference(), Dest::pid(), Args::[any()]) -> ok | {error, term()}

Bind parameters to a prepared statement.

column_names/4

column_names(Db::raw_connection(), Stmt::raw_statement(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Retrieve the column names of the prepared statement

column_types/4

column_types(Db::raw_connection(), Stmt::raw_statement(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Retrieve the column types of the prepared statement

backup_init/6

backup_init(DestDb::raw_connection(), DestName::string(), SourceDb::raw_connection(), SourceName::string(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Initialize a backup procedure of a database.

backup_step/5

backup_step(Db::raw_connection(), Backup::raw_backup(), NPages::integer(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Do a backup step.

backup_remaining/4

backup_remaining(Db::raw_connection(), Backup::raw_backup(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Get the amount of remaining pages which need to be backed up.

backup_pagecount/4

backup_pagecount(Db::raw_connection(), Backup::raw_backup(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Get the total number of pages which need to be backed up.

backup_finish/4

backup_finish(Db::raw_connection(), Backup::raw_backup(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Finish the backup.

interrupt/1

interrupt(Db::raw_connection()) -> ok

Interrupt all active queries.

close/3

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

Close the connection.

insert/4

insert(Db::raw_connection(), Ref::reference(), Dest::pid(), Sql::sql()) -> ok | {error, term()}

Insert record

last_insert_rowid/3

last_insert_rowid(Db::raw_connection(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Get the last insert rowid.

get_autocommit/3

get_autocommit(Db::raw_connection(), Ref::reference(), Dest::pid()) -> ok | {error, term()}

Get automcommit


Generated by EDoc