Module esqlite3

Erlang API for sqlite3 databases.

Copyright © 2011, 2012, 2013 Maas-Maarten Zeeman

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

Description

Erlang API for sqlite3 databases

Data Types

connection()

connection() = tuple()

sql()

sql() = iolist()

statement()

statement() = term()

Function Index

bind/2Bind values to prepared statements.
bind/3Bind values to prepared statements.
changes/1Return the number of affected rows of last statement.
changes/2Return the number of affected rows of last statement.
close/1Close the database.
close/2Close the database.
column_names/1Return the column names of the prepared statement.
column_names/2
column_types/1Return the column types of the prepared statement.
column_types/2
exec/2Execute Sql statement, returns the number of affected rows.
exec/3Execute.
fetchall/1
fetchone/1
foreach/3
insert/2Insert records, returns the last rowid.
map/3
open/1Opens a sqlite3 database mentioned in Filename.
open/2Open a database connection.
prepare/2Prepare a statement.
prepare/3.
q/2Execute a sql statement, returns a list with tuples.
q/3Execute statement, bind args and return a list with tuples as result.
reset/1Reset the prepared statement back to its initial state.
step/1Step.
step/2.

Function Details

bind/2

bind(Stmt::prepared_statement(), Args::value_list()) -> ok | {error, error_message()}

Bind values to prepared statements

bind/3

bind(Stmt::prepared_statement(), Args::[], Timeout::timeout()) -> ok | {error, error_message()}

Bind values to prepared statements

changes/1

changes(Connection) -> any()

Return the number of affected rows of last statement.

changes/2

changes(X1, Timeout) -> any()

Return the number of affected rows of last statement.

close/1

close(Connection::connection()) -> ok | {error, error_message()}

Close the database

close/2

close(X1::connection(), Timeout::integer()) -> ok | {error, error_message()}

Close the database

column_names/1

column_names(Stmt::statement()) -> {atom()}

Return the column names of the prepared statement.

column_names/2

column_names(Stmt::statement(), Timeout::timeout()) -> {atom()}

column_types/1

column_types(Stmt::statement()) -> {atom()}

Return the column types of the prepared statement.

column_types/2

column_types(Stmt::statement(), Timeout::timeout()) -> {atom()}

exec/2

exec(Sql::iolist(), Connection::connection()) -> integer() | {error, error_message()}

Execute Sql statement, returns the number of affected rows.

exec/3

exec(Sql::iolist(), Params::connection(), Timeout::timeout()) -> integer() | {error, error_message()}

Execute

fetchall/1

fetchall(Statement::statement()) -> [tuple()] | {error, term()}

fetchone/1

fetchone(Statement::statement()) -> tuple()

foreach/3

foreach(F, Sql::sql(), Connection::connection()) -> ok

insert/2

insert(Sql::iolist(), Connection::connection()) -> {ok, integer()} | {error, error_message()}

Insert records, returns the last rowid.

map/3

map(F, Sql::sql(), Connection::connection()) -> [Type]

open/1

open(FileName) -> {ok, connection()} | {error, term()}

Opens a sqlite3 database mentioned in Filename.

open/2

open(Filename, Timeout::timeout()) -> {ok, connection()} | {error, term()}

Open a database connection

prepare/2

prepare(Sql::iolist(), Connection::connection()) -> {ok, prepared_statement()} | {error, error_message()}

Prepare a statement

prepare/3

prepare(Sql, X2, Timeout) -> any()

q/2

q(Sql::sql(), Connection::connection()) -> [tuple()]

Execute a sql statement, returns a list with tuples.

q/3

q(Sql::sql(), Args::list(), Connection::connection()) -> [tuple()]

Execute statement, bind args and return a list with tuples as result.

reset/1

reset(Stmt::prepared_statement()) -> ok | {error, error_message()}

Reset the prepared statement back to its initial state.

step/1

step(Stmt::prepared_statement()) -> tuple()

Step

step/2

step(Stmt::prepared_statement(), Timeout::timeout()) -> tuple()


Generated by EDoc