Database Independent Abstraction Layer for C

libdbi Driver Author's Guide

David A. Parker

Neon Goat Productions

Markus Hoenicka

libdbi implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl. Writing one generic set of code, programmers can leverage the power of multiple databases and multiple simultaneous database connections by using this framework.

This guide explains the internal DBD interface for libdbi drivers, and provides a reference for all available driver helper functions.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in Appendix A.


Table of Contents
1. Introduction
1.1. Description
1.2. libdbi Concepts and Terminology
1.3. Modifications and redistribution of libdbi
1.4. Contact Info
2. Driver Infrastructure
2.1. Driver Capabilities
2.1.1. Setting driver capabilities
2.1.2. Required driver capabilities
2.1.3. Recommended driver capabilities
2.2. Database directories
2.2.1. Default Database Directories
2.2.2. Custom Database Directories
2.3. Driver data
2.3.1. Driver specific functions
2.3.2. Reserved words
3. Driver Functions
3.1. Driver Infrastructure Functions
3.1.1. dbd_register_driver
3.1.2. dbd_initialize
3.1.3. dbd_connect
3.1.4. dbd_disconnect
3.1.5. dbd_geterror
3.1.6. dbd_get_socket
3.2. Internal Database Query Functions
3.2.1. dbd_goto_row
3.2.2. dbd_fetch_row
3.2.3. dbd_free_query
3.3. Public Database Query Functions
3.3.1. dbd_get_encoding
3.3.2. dbd_encoding_to_iana
3.3.3. dbd_encoding_from_iana
3.3.4. dbd_get_engine_version
3.3.5. dbd_list_dbs
3.3.6. dbd_list_tables
3.3.7. dbd_quote_string
3.3.8. dbd_conn_quote_string
3.3.9. dbd_quote_binary
3.3.10. dbd_query
3.3.11. dbd_query_null
3.3.12. dbd_select_db
3.3.13. dbd_get_seq_last
3.3.14. dbd_get_seq_next
3.3.15. dbd_ping
3.4. DBD Helper Functions
3.4.1. _dbd_result_create
3.4.2. _dbd_result_set_numfields
3.4.3. _dbd_result_add_field
3.4.4. _dbd_row_allocate
3.4.5. _dbd_row_finalize
3.4.6. _dbd_internal_error_handler
3.4.7. _dbd_result_create_from_stringarray
3.4.8. _dbd_register_driver_cap
3.4.9. _dbd_register_conn_cap
3.4.10. _dbd_parse_datetime
3.4.11. _dbd_escape_chars
3.4.12. _dbd_encode_binary
3.4.13. _dbd_decode_binary
A. GNU Free Documentation License