Rustler NIF declarations for the turso crate.
Every function here is replaced at load time by its native implementation in
native/ex_turso/src/lib.rs. The bodies below only exist so the module
compiles and raises a clear error if the NIF fails to load.
All NIFs are scheduled on dirty IO threads and return {:error, {code, reason}}
on failure, where code is an error-class atom (see Turso.Error.code/0)
and reason is a string.
Summary
Types
Error tuple returned by every NIF: an error-class atom plus a message.
Functions
Flush and release a connection. Returns :ok.
Release a local database handle. Returns :ok.
Release a synced database handle. Returns :ok.
Open a connection against a database handle.
Open a connection against a synced database.
Execute a statement, returning the number of affected rows.
Open (or create) a local database file. Returns {:ok, db} or {:error, {code, reason}}.
Open (or create) a local database synced with a remote database.
Run a query, returning rows as a list of maps keyed by column name.
Run a query, returning ordered column names and ordered row values.
Run bidirectional sync.
Types
@type nif_error() :: {Turso.Error.code(), String.t()}
Error tuple returned by every NIF: an error-class atom plus a message.
Functions
@spec close(reference()) :: :ok
Flush and release a connection. Returns :ok.
@spec close_db(reference()) :: :ok
Release a local database handle. Returns :ok.
@spec close_sync_db(reference()) :: :ok
Release a synced database handle. Returns :ok.
Open a connection against a database handle.
Open a connection against a synced database.
@spec execute(reference(), String.t(), list()) :: {:ok, non_neg_integer()} | {:error, nif_error()}
Execute a statement, returning the number of affected rows.
Open (or create) a local database file. Returns {:ok, db} or {:error, {code, reason}}.
Open (or create) a local database synced with a remote database.
Run a query, returning rows as a list of maps keyed by column name.
@spec query_rows(reference(), String.t(), list()) :: {:ok, {[String.t()], [[term()]]}} | {:error, nif_error()}
Run a query, returning ordered column names and ordered row values.
Run bidirectional sync.