|
KDBC
Unified C Database Connectivity — SQLite, PostgreSQL, MariaDB, Oracle, MSSQL
|
Functions | |
| const char * | kdbc_error (kdbc_conn *conn) |
| Get the last error message for a connection. | |
| const char * | kdbc_stmt_error (kdbc_stmt *stmt) |
| Get the last error message for a statement. | |
| const char * | kdbc_global_error (void) |
| Get the last global (connection-less) error message. | |
Retrieve error messages from connections, statements, or global context.
Each handle (kdbc_conn, kdbc_stmt) maintains its own error buffer (1024 bytes). The global error buffer is thread-local, used for errors that occur outside a connection context (e.g. driver not available, connection failure).
Returned pointers are valid until the next KDBC call on the same handle, or until the handle is closed. Returns "" (empty string) when no error has occurred.
| const char * kdbc_error | ( | kdbc_conn * | conn | ) |
Get the last error message for a connection.
| conn | The connection to query. |
| const char * kdbc_stmt_error | ( | kdbc_stmt * | stmt | ) |
Get the last error message for a statement.
| stmt | The statement to query. |
| const char * kdbc_global_error | ( | void | ) |
Get the last global (connection-less) error message.
Used for errors that occur before a connection exists, such as driver-not-available or connection failure. Thread-local — safe to call from any thread.