|
KDBC
Unified C Database Connectivity — SQLite, PostgreSQL, MariaDB, Oracle, MSSQL
|
Macros | |
| #define | KDBC_OK 0 |
| #define | KDBC_ERROR (-1) |
Typedefs | |
| typedef struct kdbc_conn | kdbc_conn |
| Opaque database connection handle. | |
| typedef struct kdbc_stmt | kdbc_stmt |
| Opaque prepared statement handle. | |
| typedef struct kdbc_result | kdbc_result |
| Opaque result set handle. | |
Enumerations | |
| enum | kdbc_driver { KDBC_SQLITE = 0 , KDBC_POSTGRES = 1 , KDBC_MARIADB = 2 , KDBC_ORACLE = 3 , KDBC_MSSQL = 4 , KDBC_DRIVER_COUNT = 5 } |
| Supported database drivers. More... | |
| enum | kdbc_type { KDBC_TYPE_NULL = 0 , KDBC_TYPE_INT = 1 , KDBC_TYPE_LONG = 2 , KDBC_TYPE_DOUBLE = 3 , KDBC_TYPE_STRING = 4 , KDBC_TYPE_BLOB = 5 , KDBC_TYPE_BOOL = 6 , KDBC_TYPE_DATE = 7 , KDBC_TYPE_TIME = 8 , KDBC_TYPE_TIMESTAMP = 9 } |
| Column / parameter value types. More... | |
| enum | kdbc_gk_strategy { KDBC_GK_NONE = 0 , KDBC_GK_BY_INDEX = 1 , KDBC_GK_BY_NAME = 2 } |
| Generated-key retrieval strategies. More... | |
Core types, enumerations, and return codes.
| #define KDBC_OK 0 |
Returned on success.
| #define KDBC_ERROR (-1) |
Returned on failure — call the appropriate error function for details.
| typedef struct kdbc_result kdbc_result |
Opaque result set handle.
| enum kdbc_driver |
Supported database drivers.
Each value corresponds to a backend that KDBC can load at runtime. Use kdbc_driver_available() to check whether the native client library for a given driver is installed on the current system.
| enum kdbc_type |
Column / parameter value types.
Returned by type-inspection APIs and used internally for parameter binding.
| enum kdbc_gk_strategy |
Generated-key retrieval strategies.
Different databases use different mechanisms to return auto-generated primary keys after an INSERT.
| Strategy | Databases | Mechanism |
|---|---|---|
| KDBC_GK_NONE | Oracle 11g | Uses sequences explicitly |
| KDBC_GK_BY_INDEX | SQLite, MariaDB/MySQL, MSSQL 2012+ | last_insert_id / SCOPE_IDENTITY |
| KDBC_GK_BY_NAME | PostgreSQL, Oracle 12c+ | RETURNING clause |