← Back to Stormify Documentation
KDBC
Unified C Database Connectivity — SQLite, PostgreSQL, MariaDB, Oracle, MSSQL
Loading...
Searching...
No Matches
Driver Discovery

Functions

int kdbc_driver_available (kdbc_driver driver)
 Check if a driver's native library is available on this system.
const char * kdbc_driver_name (kdbc_driver driver)
 Get the human-readable name of a driver.
kdbc_gk_strategy kdbc_driver_gk_strategy (kdbc_driver driver)
 Get the default generated-key strategy for a driver.
kdbc_gk_strategy kdbc_conn_gk_strategy (kdbc_conn *conn)
 Get the generated-key strategy for an open connection.
int kdbc_driver_supports_release_savepoint (kdbc_driver driver)
 Check if a driver supports RELEASE SAVEPOINT.

Detailed Description

Check which database backends are available at runtime.

Function Documentation

◆ kdbc_driver_available()

int kdbc_driver_available ( kdbc_driver driver)

Check if a driver's native library is available on this system.

Triggers a dlopen attempt on first call for the given driver. The result is cached — subsequent calls are cheap.

Parameters
driverThe driver to check.
Returns
1 if the native library was found, 0 otherwise.

◆ kdbc_driver_name()

const char * kdbc_driver_name ( kdbc_driver driver)

Get the human-readable name of a driver.

Parameters
driverThe driver to query.
Returns
A static string such as "SQLite", "PostgreSQL", etc.

◆ kdbc_driver_gk_strategy()

kdbc_gk_strategy kdbc_driver_gk_strategy ( kdbc_driver driver)

Get the default generated-key strategy for a driver.

This is the compile-time default. For a connection-specific strategy (which may differ based on server version), use kdbc_conn_gk_strategy().

Parameters
driverThe driver to query.
Returns
The default strategy for this driver type.

◆ kdbc_conn_gk_strategy()

kdbc_gk_strategy kdbc_conn_gk_strategy ( kdbc_conn * conn)

Get the generated-key strategy for an open connection.

May differ from the driver default based on server version. For example, Oracle 12c+ returns KDBC_GK_BY_NAME while Oracle 11g returns KDBC_GK_NONE.

Parameters
connAn open connection.
Returns
The strategy appropriate for this connection's server version.

◆ kdbc_driver_supports_release_savepoint()

int kdbc_driver_supports_release_savepoint ( kdbc_driver driver)

Check if a driver supports RELEASE SAVEPOINT.

Oracle and MSSQL do not support releasing savepoints. Call this before using kdbc_release_savepoint().

Parameters
driverThe driver to query.
Returns
1 if supported, 0 if not.