dorm.lib.ffi_impl

Undocumented in source.

Members

Aliases

DBConnectCallback
alias DBConnectCallback = void function(void* context, DBHandle handle, scope RormError error) nothrow

Connect to the database using the provided DBConnectOptions.

DBDeleteCallback
alias DBDeleteCallback = void function(void* context, ulong rowsAffected, scope RormError)

This function deletes rows from the database based on the given conditions.

DBInsertCallback
alias DBInsertCallback = void function(void* context, scope RormError)

This function inserts one row (rorm_db_insert) or multiple rows (rorm_db_inset_bulk) into the given the database with the given values.

DBQueryAllCallback
alias DBQueryAllCallback = void function(void* context, scope FFIArray!DBRowHandle row, scope RormError)
DBQueryOneCallback
alias DBQueryOneCallback = void function(void* context, scope DBRowHandle row, scope RormError)
DBQueryOptionalCallback
alias DBQueryOptionalCallback = void function(void* context, scope DBRowHandle row, scope RormError)

This function queries the database given the provided parameters.

DBQueryStreamCallback
alias DBQueryStreamCallback = void function(void* context, DBStreamHandle stream, scope RormError)

This function queries the database given the provided parameters.

DBRawSQLCallback
alias DBRawSQLCallback = void function(void* context, scope FFIArray!DBRowHandle rows, scope RormError)

This function executes a raw SQL statement.

DBStartTransactionCallback
alias DBStartTransactionCallback = void function(void* context, DBTransactionHandle handle, scope RormError)

Starts a transaction on the current database connection.

DBStreamGetRowCallback
alias DBStreamGetRowCallback = void function(void* context, DBRowHandle row, scope RormError) nothrow

Fetches the next row from the stream. Must not be called in parallel on the same stream. Returns Error.NoRowsLeftInStream when the stream is finished.

DBTransactionCommitCallback
alias DBTransactionCommitCallback = void function(void* context, scope RormError)

Commits a transaction.

DBTransactionRollbackCallback
alias DBTransactionRollbackCallback = void function(void* context, scope RormError)

Rollback a transaction and abort it.

DBUpdateCallback
alias DBUpdateCallback = void function(void* context, ulong rowsAffected, scope RormError)

This function updates rows in the database.

FFIString
alias FFIString = FFIArray!(const(char))

Representation of a string.

RuntimeShutdownCallback
alias RuntimeShutdownCallback = void function(void* context, scope RormError)

Shutdown the runtime.

RuntimeStartCallback
alias RuntimeStartCallback = void function(void* context, scope RormError)

This function is used to initialize and start the async runtime.

Enums

DBBackend
enum DBBackend

Representation of the database backend.

DBHandle
enum DBHandle
DBRowHandle
enum DBRowHandle
DBRowListHandle
enum DBRowListHandle
DBStreamHandle
enum DBStreamHandle
DBTransactionHandle
enum DBTransactionHandle

Type-safe alias for different handles to void*, to avoid using them in wrong functions accidentally. Try not to use the init value, it's simply a null pointer.

FFIJoinType
enum FFIJoinType

Representation of a join type.

FFIOrdering
enum FFIOrdering

For use with FFIOrderByEntry

Functions

ffi
FFIString ffi(string s)
FFIArray!T ffi(T[] s)
FFIArray!T ffi(T[n] s)

helper function to create an FFI slice of a D native array/slice type.

rorm_db_connect
void rorm_db_connect(DBConnectOptions options, DBConnectCallback callback, void* context)

Connect to the database using the provided DBConnectOptions.

rorm_db_delete
void rorm_db_delete(DBHandle db, DBTransactionHandle transaction, FFIString model, const(FFICondition)* condition, DBDeleteCallback callback, void* context)

This function deletes rows from the database based on the given conditions.

rorm_db_free
void rorm_db_free(DBHandle handle)

Closes all of the database connections and frees the handle. No database operations may be pending when calling this!

rorm_db_insert
void rorm_db_insert(DBHandle db, DBTransactionHandle transaction, FFIString model, FFIArray!FFIString columns, FFIArray!FFIValue row, DBInsertCallback callback, void* context)
rorm_db_insert_bulk
void rorm_db_insert_bulk(DBHandle db, DBTransactionHandle transaction, FFIString model, FFIArray!FFIString columns, FFIArray!(FFIArray!FFIValue) rows, DBInsertCallback callback, void* context)

This function inserts one row (rorm_db_insert) or multiple rows (rorm_db_inset_bulk) into the given the database with the given values.

rorm_db_query_all
void rorm_db_query_all(DBHandle handle, DBTransactionHandle transaction, FFIString model, FFIArray!FFIColumnSelector columns, FFIArray!FFIJoin joins, const(FFICondition)* condition, FFIArray!FFIOrderByEntry orderBy, FFIOption!FFILimitClause limit, DBQueryAllCallback callback, void* context)
rorm_db_query_one
void rorm_db_query_one(DBHandle handle, DBTransactionHandle transaction, FFIString model, FFIArray!FFIColumnSelector columns, FFIArray!FFIJoin joins, const(FFICondition)* condition, FFIArray!FFIOrderByEntry orderBy, FFIOption!ulong offset, DBQueryOneCallback callback, void* context)
rorm_db_query_optional
void rorm_db_query_optional(DBHandle handle, DBTransactionHandle transaction, FFIString model, FFIArray!FFIColumnSelector columns, FFIArray!FFIJoin joins, const(FFICondition)* condition, FFIArray!FFIOrderByEntry orderBy, FFIOption!ulong offset, DBQueryOptionalCallback callback, void* context)

This function queries the database given the provided parameters.

rorm_db_query_stream
void rorm_db_query_stream(DBHandle handle, DBTransactionHandle transaction, FFIString model, FFIArray!FFIColumnSelector columns, FFIArray!FFIJoin joins, const(FFICondition)* condition, FFIArray!FFIOrderByEntry orderBy, FFIOption!FFILimitClause limit, DBQueryStreamCallback callback, void* context)

This function queries the database given the provided parameters.

rorm_db_raw_sql
void rorm_db_raw_sql(DBHandle db, DBTransactionHandle transaction, FFIString query_string, FFIArray!FFIValue bind_params, DBRawSQLCallback callback, void* context)

This function executes a raw SQL statement.

rorm_db_start_transaction
void rorm_db_start_transaction(DBHandle db, DBStartTransactionCallback callback, void* context)

Starts a transaction on the current database connection.

rorm_db_update
void rorm_db_update(DBHandle db, DBTransactionHandle transaction, FFIString model, FFIArray!FFIUpdate updates, const(FFICondition)* condition, DBUpdateCallback callback, void* context)

This function updates rows in the database.

rorm_row_free
void rorm_row_free(DBRowHandle row)

Frees the row handle given as parameter.

rorm_row_get_binary
FFIArray!(const ubyte) rorm_row_get_binary(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_bool
bool rorm_row_get_bool(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_date
FFIDate rorm_row_get_date(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_datetime
FFIDateTime rorm_row_get_datetime(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_f32
float rorm_row_get_f32(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_f64
double rorm_row_get_f64(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_i16
short rorm_row_get_i16(DBRowHandle handle, FFIString column, RormError ref_error)
rorm_row_get_i32
int rorm_row_get_i32(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_i64
long rorm_row_get_i64(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_binary
FFIOption!(FFIArray!(const ubyte)) rorm_row_get_null_binary(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_bool
FFIOption!bool rorm_row_get_null_bool(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_date
FFIOption!FFIDate rorm_row_get_null_date(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_datetime
FFIOption!FFIDateTime rorm_row_get_null_datetime(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_f32
FFIOption!float rorm_row_get_null_f32(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_f64
FFIOption!double rorm_row_get_null_f64(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_i16
FFIOption!short rorm_row_get_null_i16(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_i32
FFIOption!int rorm_row_get_null_i32(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_i64
FFIOption!long rorm_row_get_null_i64(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_str
FFIOption!FFIString rorm_row_get_null_str(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_null_time
FFIOption!FFITime rorm_row_get_null_time(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_str
FFIString rorm_row_get_str(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_row_get_time
FFITime rorm_row_get_time(DBRowHandle handle, FFIString column, RormError ref_error)
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
rorm_runtime_shutdown
void rorm_runtime_shutdown(ulong timeoutMsecs, RuntimeShutdownCallback callback, void* context)

Shutdown the runtime.

rorm_runtime_start
void rorm_runtime_start(RuntimeStartCallback callback, void* context)

This function is used to initialize and start the async runtime.

rorm_stream_free
void rorm_stream_free(DBStreamHandle handle)

Frees the stream given as parameter. The stream must be in a freeable state.

rorm_stream_get_row
void rorm_stream_get_row(DBStreamHandle stream, DBStreamGetRowCallback callback, void* context)

Fetches the next row from the stream. Must not be called in parallel on the same stream. Returns Error.NoRowsLeftInStream when the stream is finished.

rorm_transaction_commit
void rorm_transaction_commit(DBTransactionHandle transaction, DBTransactionCommitCallback callback, void* context)

Commits a transaction.

rorm_transaction_rollback
void rorm_transaction_rollback(DBTransactionHandle transaction, DBTransactionRollbackCallback callback, void* context)

Rollback a transaction and abort it.

Structs

DBConnectOptions
struct DBConnectOptions

Configuration operation to connect to a database.

FFIArray
struct FFIArray(T)

rorm FFI struct definition for arrays and strings (equivalent to D and Rust slices)

FFIBinaryCondition
struct FFIBinaryCondition

This condition subtype represents all available binary conditions. (operations with two operands)

FFIColumn
struct FFIColumn

Contains a column name / reference that can be used in condition values.

FFIColumnSelector
struct FFIColumnSelector

Allows specifying SQL table_name.column_name as select_alias syntax in a DB-agnostic way.

FFICondition
struct FFICondition

Represents a (sub-)tree of one or more condition parts.

FFIDate
struct FFIDate

Representation of any date

FFIDateTime
struct FFIDateTime

Representation of a date and time (without timezone)

FFIJoin
struct FFIJoin

FFI representation of a Join expression.

FFILimitClause
struct FFILimitClause

Allows limiting query response count and offsetting which row is the first row.

FFIOption
struct FFIOption(T)

optional value returned by rorm functions.

FFIOrderByEntry
struct FFIOrderByEntry

Represents a single part of an ORDER BY clause in SQL.

FFITernaryCondition
struct FFITernaryCondition

This condition subtype represents all available ternary conditions. (operations with three operands)

FFITime
struct FFITime

Representation of a time of the day.

FFIUnaryCondition
struct FFIUnaryCondition

This condition subtype represents all available unary conditions. (operations with a single operand)

FFIUpdate
struct FFIUpdate

Part of a table update, being one column with the new value.

FFIValue
struct FFIValue

Represents a leaf node in a condition tree, effectively inserting a static value like a string, identifier or number.

RormError
struct RormError

Error struct passed into rorm callbacks. Generally this may not escape the callback, so it must always be used with scope, unless otherwise documented.

Meta