Expand description
This module provides some C-Like interfaces from sqlite-wasm.
Re-exports§
pub use crate::init_sqlite;
pub use crate::libsqlite3::*;
Functions§
- Implementations of aggregate SQL functions use this routine to allocate memory for storing their state.
- Bind a
BLOB
value to a parameter in a prepared statement. - Bind a double precision floating point number to a parameter in a prepared statement.
- Bind an integer number to a parameter in a prepared statement.
- Bind a 64 bit integer number to a parameter in a prepared statement.
- Bind a
NULL
value to a parameter in a prepared statement. - Bind a
TEXT
value to a parameter in a prepared statement. - Returns the number of rows modified, inserted or deleted by the most recently completed
INSERT
,UPDATE
orDELETE
statement on the database connection specified by the only parameter. Executing any other type of SQL statement does not modify the value returned by these functions.REturn
value is undefined if the number of changes is bigger than 32 bits. Usesqlite3_changes64()
instead in these cases. - Destructor for the
sqlite3
object. - Destructor for the
sqlite3
object. - Returns the number of columns in the result set returned by the prepared statement.
- Returns the name assigned to a particular column in the result set of a
SELECT statement
. - Get a
sql_value*
result value from a column in the current result row. - Returns a copy of the pointer to the database connection (the 1st parameter) of the
sqlite3_create_function()
routine that originally registered the application defined function. - Add a collation to a database connection.
- Add SQL function or aggregation or redefine the behavior of an existing SQL function or aggregation.
- Returns the database connection handle to which a prepared statement belongs. The database connection returned by
sqlite3_db_handle
is the same database connection that was the first argument to thesqlite3_prepare_v2()
call (or its variants) that was used to create the statement in the first place. - Causes the database connection
db
to disconnect from databaseschema
and then reopenschema
as an in-memory database based on the serialization contained indata
. The serialized databasedata
isdbSize
bytes in size.bufferSize
is the size of the bufferdata
, which might be larger thandbSize
. IfbufferSize
is larger thandbSize
, and theSQLITE_DESERIALIZE_READONLY
bit is not set inflags
, thenSQLite
is permitted to add content to the in-memory database as long as the total size does not exceedbufferSize
bytes. - If the most recent
sqlite3_*
API call associated with database connectiondb
failed, then thesqlite3_errmsg(db)
interface returns English- language text that describes the error. - A convenience wrapper around
sqlite3_prepare_v2()
,sqlite3_step()
, andsqlite3_finalize()
, that allows an application to run multiple statements of SQL without having to use a lot of C code. - If the most recent
sqlite3_*
API call associated with database connectiondb
failed, then thesqlite3_extended_errcode(db)
interface returns the extended result code for that API call, even when extended result codes are disabled. - The
sqlite3_finalize()
function is called to delete a prepared statement. If the most recent evaluation of the statement encountered no errors or if the statement is never been evaluated, thensqlite3_finalize()
returnsSQLITE_OK
. If the most recent evaluation of statementstmt
failed, thensqlite3_finalize(stmt)
returns the appropriate error code or extended error code. - Calling
sqlite3_free()
with a pointer previously returned bysqlite3_malloc()
orsqlite3_realloc()
releases that memory so that it might be reused. - Open an
SQLite
database file as specified by thefilename
argument and support opfs vfs on wasm platform. - Compiles a prepared statement.
- Called to reset a [prepared statement] object back to its initial state, ready to be re-executed. Any SQL statement variables that had values bound to them using the
sqlite3_bind_*()
API retain their values. Usesqlite3_clear_bindings()
to reset the bindings. - Sets the result from an application-defined function to be the
BLOB
whose content is pointed to by the second parameter and which isblobLen
bytes long. - Sets the result from an application-defined function to be a floating point value specified by its 2nd argument.
- Cause the implemented SQL function to throw an exception.
- Sets the return value of the application-defined function to be the 32-bit signed integer value given in the 2nd argument.
- Sets the return value of the application-defined function to be the 64-bit signed integer value given in the 2nd argument.
- Sets the return value of the application-defined function to be
NULL
. - Set the return value of the application-defined function to be a text string
- Returns a pointer to memory that is a serialization of the
schema
database on database connectiondb
. IfpiSize
is not a NULL pointer, then the size of the database in bytes is written into*piSize
. - After a prepared statement has been prepared using any of
sqlite3_prepare_v2()
,sqlite3_prepare_v3()
,sqlite3_prepare16_v2()
, orsqlite3_prepare16_v3()
or one of the legacy interfacessqlite3_prepare()
orsqlite3_prepare16()
, this function must be called one or more times to evaluate the statement. - Returns a copy of the pointer that was the
pUserData
parameter (the 5th parameter) of thesqlite3_create_function()
routine that originally registered the application defined function. - Extract a
BLOB
value from a protectedsqlite3_value
object. - Get the size of a
BLOB
orTEXT
value in bytes from a protectedsqlite3_value
object. - Extract a
REAL
value from a protectedsqlite3_value
object. - Makes a copy of the
sqlite3_value
objectsqliteValue
and returns a pointer to that copy. Thesqlite3_value
returned is a protectedsqlite3_value
object even if the input is not. If `sqliteValue is a pointer value, then the result is a NULL value. - Frees an
sqlite3_value
object previously obtained fromsqlite3_value_dup()
. - Extract a
INTEGER
value from a protectedsqlite3_value
object. - Extract a 64-bit
INTEGER
value from a protectedsqlite3_value
object. - Extract a
TEXT
value from a protectedsqlite3_value
object. - Get the default datatype of the value from a protected
sqlite3_value
object.