SqliteEngine.Sqlite3NIF (SqliteEngine v0.1.1)

Copy Markdown View Source

This is the module where all of the NIF entry points reside. Calling this directly should be avoided unless you are aware of what you are doing.

Summary

Types

db()

@type db() :: reference()

reason()

@type reason() :: :atom | String.Chars.t()

row()

@type row() :: list()

statement()

@type statement() :: reference()

Functions

batch_step(conn, statement, rows)

@spec batch_step(db(), statement(), [list()]) ::
  {:ok, non_neg_integer()} | :busy | {:error, reason()}

bind_blob(stmt, index, blob)

@spec bind_blob(statement(), non_neg_integer(), binary()) :: integer()

bind_float(stmt, index, float)

@spec bind_float(statement(), non_neg_integer(), float()) :: integer()

bind_integer(stmt, index, integer)

@spec bind_integer(statement(), non_neg_integer(), integer()) :: integer()

bind_null(stmt, index)

@spec bind_null(statement(), non_neg_integer()) :: integer()

bind_parameter_count(stmt)

@spec bind_parameter_count(statement()) :: non_neg_integer() | {:error, reason()}

bind_parameter_index(stmt, name)

@spec bind_parameter_index(statement(), String.t()) :: non_neg_integer()

bind_text(stmt, index, text)

@spec bind_text(statement(), non_neg_integer(), String.t()) :: integer()

build_info()

@spec build_info() :: map()

cancel(conn)

@spec cancel(db()) :: :ok | {:error, reason()}

changes(conn)

@spec changes(db()) :: {:ok, integer()} | {:error, reason()}

close(conn)

@spec close(db()) :: :ok | {:error, reason()}

columns(conn, statement)

@spec columns(db(), statement()) :: {:ok, [binary()]} | {:error, reason()}

deserialize(conn, database, serialized)

@spec deserialize(db(), String.t(), binary()) :: :ok | {:error, reason()}

enable_load_extension(conn, flag)

@spec enable_load_extension(db(), integer()) :: :ok | {:error, reason()}

errmsg(db_or_stmt)

@spec errmsg(db() | statement()) :: String.t() | nil

errstr(rc)

@spec errstr(integer()) :: String.t()

execute(conn, sql)

@spec execute(db(), String.t()) :: :ok | {:error, reason()}

execute_luau(conn, key)

@spec execute_luau(db(), binary()) ::
  {:ok, nil | boolean() | number() | binary()} | {:error, reason()}

execute_luau_batch(conn, key, count)

@spec execute_luau_batch(db(), binary(), pos_integer()) ::
  {:ok, pos_integer()} | {:error, reason()}

execute_luau_commands(conn, commands, limits)

@spec execute_luau_commands(db(), [{binary(), binary(), binary()}], tuple()) ::
  {:ok, [binary()]} | {:error, reason()}

execute_luau_encoded(conn, key, command, context, limits)

@spec execute_luau_encoded(db(), binary(), binary(), binary(), tuple()) ::
  {:ok, binary()} | {:error, reason()}

has_luau_chunk(conn, key)

@spec has_luau_chunk(db(), binary()) :: boolean()

interrupt(conn)

@spec interrupt(db()) :: :ok | {:error, reason()}

last_insert_rowid(conn)

@spec last_insert_rowid(db()) :: {:ok, integer()}

load_nif()

luau_stats(conn)

@spec luau_stats(db()) :: {:ok, map()}

multi_step(conn, statement, chunk_size)

@spec multi_step(db(), statement(), integer()) ::
  :busy | {:rows, [row()]} | {:done, [row()]} | {:error, reason()}

open(path, flags)

@spec open(String.t(), integer()) :: {:ok, db()} | {:error, reason()}

prepare(conn, sql)

@spec prepare(db(), String.t()) :: {:ok, statement()} | {:error, reason()}

prepare_luau(conn, key, source)

@spec prepare_luau(db(), binary(), binary()) :: {:ok, binary()} | {:error, reason()}

release(conn, statement)

@spec release(db(), statement()) :: :ok | {:error, reason()}

reset(stmt)

@spec reset(statement()) :: :ok

serialize(conn, database)

@spec serialize(db(), String.t()) :: {:ok, binary()} | {:error, reason()}

set_authorizer(conn, deny_list)

@spec set_authorizer(db(), [atom()]) :: :ok | {:error, reason()}

set_busy_timeout(conn, timeout_ms)

@spec set_busy_timeout(db(), integer()) :: :ok | {:error, reason()}

set_log_hook(pid)

@spec set_log_hook(pid()) :: :ok | {:error, reason()}

set_progress_handler_steps(conn, steps)

@spec set_progress_handler_steps(db(), integer()) :: :ok | {:error, reason()}

set_update_hook(conn, pid)

@spec set_update_hook(db(), pid()) :: :ok | {:error, reason()}

step(conn, statement)

@spec step(db(), statement()) :: :done | :busy | {:row, row()} | {:error, reason()}

transaction_status(conn)

@spec transaction_status(db()) :: {:ok, :idle | :transaction}