Function libduckdb_sys::duckdb_prepare [−][src]
pub unsafe extern "C" fn duckdb_prepare(
connection: duckdb_connection,
query: *const c_char,
out_prepared_statement: *mut duckdb_prepared_statement
) -> duckdb_state
Expand description
Create a prepared statement object from a query.
Note that after calling duckdb_prepare
, the prepared statement should always be destroyed using
duckdb_destroy_prepare
, even if the prepare fails.
If the prepare fails, duckdb_prepare_error
can be called to obtain the reason why the prepare failed.
connection: The connection object
query: The SQL query to prepare
out_prepared_statement: The resulting prepared statement object
returns: DuckDBSuccess
on success or DuckDBError
on failure.