pub unsafe extern "C" fn duckdb_get_or_create_from_cache(
instance_cache: duckdb_instance_cache,
path: *const c_char,
out_database: *mut duckdb_database,
config: duckdb_config,
out_error: *mut *mut c_char,
) -> duckdb_state
Expand description
Creates a new database instance in the instance cache, or retrieves an existing database instance. Must be closed with ‘duckdb_close’.
@param instance_cache The instance cache in which to create the database, or from which to take the database.
@param path Path to the database file on disk. Both nullptr
and :memory:
open or retrieve an in-memory database.
@param out_database The resulting cached database.
@param config (Optional) configuration used to create the database.
@param out_error If set and the function returns DuckDBError
, this contains the error message.
Note that the error message must be freed using duckdb_free
.
@return DuckDBSuccess
on success or DuckDBError
on failure.