|
KDBC
Unified C Database Connectivity — SQLite, PostgreSQL, MariaDB, Oracle, MSSQL
|
Functions | |
| int | kdbc_execute_update_stmt (kdbc_stmt *stmt) |
| Execute a prepared DML statement (INSERT/UPDATE/DELETE). | |
| kdbc_result * | kdbc_execute_query_stmt (kdbc_stmt *stmt) |
| Execute a prepared query (SELECT). | |
| kdbc_result * | kdbc_generated_keys (kdbc_stmt *stmt) |
| Get generated keys after an INSERT. | |
| void | kdbc_stmt_close (kdbc_stmt *stmt) |
| Close a prepared statement and free resources. | |
| int | kdbc_stmt_reset (kdbc_stmt *stmt) |
| Reset a prepared statement for re-execution. | |
| int | kdbc_set_fetch_size (kdbc_stmt *stmt, int rows) |
| Set a fetch size hint for query execution. | |
Execute prepared statements and retrieve generated keys.
| int kdbc_execute_update_stmt | ( | kdbc_stmt * | stmt | ) |
Execute a prepared DML statement (INSERT/UPDATE/DELETE).
| stmt | A prepared statement with all parameters bound. |
| kdbc_result * kdbc_execute_query_stmt | ( | kdbc_stmt * | stmt | ) |
Execute a prepared query (SELECT).
The returned result set must be closed with kdbc_result_close().
| stmt | A prepared statement with all parameters bound. |
| kdbc_result * kdbc_generated_keys | ( | kdbc_stmt * | stmt | ) |
Get generated keys after an INSERT.
Returns a synthetic result set with one row containing the generated key(s). The statement must have been prepared with kdbc_prepare_returning().
| stmt | A prepared statement after execution. |
| void kdbc_stmt_close | ( | kdbc_stmt * | stmt | ) |
Close a prepared statement and free resources.
Safe to call with NULL (no-op).
| stmt | The statement to close, or NULL. |
| int kdbc_stmt_reset | ( | kdbc_stmt * | stmt | ) |
Reset a prepared statement for re-execution.
Clears all bound parameters, pending batch entries, generated key state, cached OUT-parameter values, and the error buffer so the statement can be reused with new values. Any batches accumulated via kdbc_add_batch() are discarded — call kdbc_execute_batch() first if they should run. OUT-parameter registrations are preserved; only their cached result values are cleared.
| stmt | A prepared statement. |
| int kdbc_set_fetch_size | ( | kdbc_stmt * | stmt, |
| int | rows ) |
Set a fetch size hint for query execution.
Suggests how many rows the driver should fetch per round-trip. This is a hint — drivers may ignore it.
| stmt | A prepared statement. |
| rows | Number of rows to fetch at a time (0 = driver default). |