Function rorm::rorm_db_connect
source · #[no_mangle]
pub extern "C" fn rorm_db_connect(
options: DBConnectOptions<'_>,
callback: Option<unsafe extern "C" fn(_: usize, _: Option<Box<Database>>, _: Error<'_>)>,
context: usize
)
Expand description
Connect to the database using the provided DBConnectOptions.
You must provide a callback with the following parameters:
The first parameter is the context
pointer.
The second parameter will be a pointer to the Database connection.
It will be needed to make queries.
The last parameter holds an Error enum.
Important: Rust does not manage the memory of the database. To properly free it, use rorm_db_free.
This function is called from an asynchronous context.