--- /dev/null
+#include <bindings.dsl.h>
+#include <apr_dbd.h>
+
+module Bindings.APR.DBD where
+#strict_import
+import Bindings.APR.ErrNo
+import Bindings.APR.Pools
+
+#integral_t apr_dbd_type_e
+#num APR_DBD_TYPE_NONE
+#num APR_DBD_TYPE_TINY
+#num APR_DBD_TYPE_UTINY
+#num APR_DBD_TYPE_SHORT
+#num APR_DBD_TYPE_USHORT
+#num APR_DBD_TYPE_INT
+#num APR_DBD_TYPE_UINT
+#num APR_DBD_TYPE_LONG
+#num APR_DBD_TYPE_ULONG
+#num APR_DBD_TYPE_LONGLONG
+#num APR_DBD_TYPE_ULONGLONG
+#num APR_DBD_TYPE_FLOAT
+#num APR_DBD_TYPE_DOUBLE
+#num APR_DBD_TYPE_STRING
+#num APR_DBD_TYPE_TEXT
+#num APR_DBD_TYPE_TIME
+#num APR_DBD_TYPE_DATE
+#num APR_DBD_TYPE_DATETIME
+#num APR_DBD_TYPE_TIMESTAMP
+#num APR_DBD_TYPE_ZTIMESTAMP
+#num APR_DBD_TYPE_BLOB
+#num APR_DBD_TYPE_CLOB
+#num APR_DBD_TYPE_NULL
+
+#opaque_t apr_dbd_driver_t
+#opaque_t apr_dbd_t
+#opaque_t apr_dbd_transaction_t
+#opaque_t apr_dbd_results_t
+#opaque_t apr_dbd_row_t
+#opaque_t apr_dbd_prepared_t
+
+#ccall apr_dbd_init , Ptr <apr_pool_t> -> IO <apr_status_t>
+#ccall apr_dbd_get_driver , Ptr <apr_pool_t> -> Ptr CChar -> Ptr (Ptr <apr_dbd_driver_t>) -> IO <apr_status_t>
+#ccall apr_dbd_open_ex , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr CChar -> Ptr (Ptr <apr_dbd_t>) -> Ptr (Ptr CChar) -> IO <apr_status_t>
+#ccall apr_dbd_open , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr CChar -> Ptr (Ptr <apr_dbd_t>) -> IO <apr_status_t>
+#ccall apr_dbd_close , Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_t> -> IO <apr_status_t>
+#ccall apr_dbd_name , Ptr <apr_dbd_driver_t> -> IO (Ptr CChar)
+#ccall apr_dbd_native_handle, Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_t> -> IO (Ptr ())
+#ccall apr_dbd_check_conn , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> IO CInt
+#ccall apr_dbd_set_dbname , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr CChar -> IO CInt
+
+#ccall apr_dbd_transaction_start, Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr (Ptr <apr_dbd_transaction_t>) -> IO CInt
+#ccall apr_dbd_transaction_end , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_transaction_t> -> IO CInt
+
+#num APR_DBD_TRANSACTION_COMMIT
+#num APR_DBD_TRANSACTION_ROLLBACK
+#num APR_DBD_TRANSACTION_IGNORE_ERRORS
+
+#ccall apr_dbd_transaction_mode_get, Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_transaction_t> -> IO CInt
+#ccall apr_dbd_transaction_mode_set, Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_transaction_t> -> CInt -> IO CInt
+
+#ccall apr_dbd_query , Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_t> -> Ptr CInt -> Ptr CChar -> IO CInt
+#ccall apr_dbd_select , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr (Ptr <apr_dbd_results_t>) -> Ptr CChar -> CInt -> IO CInt
+#ccall apr_dbd_num_cols , Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_results_t> -> IO CInt
+#ccall apr_dbd_num_tuples, Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_results_t> -> IO CInt
+#ccall apr_dbd_get_row , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_results_t> -> Ptr (Ptr <apr_dbd_row_t>) -> CInt -> IO CInt
+#ccall apr_dbd_get_entry , Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_row_t> -> CInt -> IO (Ptr CChar)
+#ccall apr_dbd_get_name , Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_results_t> -> CInt -> IO (Ptr CChar)
+#ccall apr_dbd_error , Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_t> -> CInt -> IO (Ptr CChar)
+#ccall apr_dbd_escape , Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_t> -> Ptr CChar -> Ptr <apr_dbd_t> -> IO (Ptr CChar)
+
+#ccall apr_dbd_prepare , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr CChar -> Ptr CChar -> Ptr (Ptr <apr_dbd_prepared_t>) -> IO CInt
+#ccall apr_dbd_pquery , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr CInt -> Ptr <apr_dbd_prepared_t> -> CInt -> Ptr (Ptr CChar) -> IO CInt
+#ccall apr_dbd_pselect , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr (Ptr <apr_dbd_results_t>) -> Ptr <apr_dbd_prepared_t> -> CInt -> CInt -> Ptr (Ptr CChar) -> IO CInt
+-- FIXME: apr_dbd_pvquery takes varargs
+-- FIXME: apr_dbd_pvselect takes varargs
+#ccall apr_dbd_pbquery , Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr CInt -> Ptr <apr_dbd_prepared_t> -> Ptr (Ptr ()) -> IO CInt
+#ccall apr_dbd_pbselect, Ptr <apr_dbd_driver_t> -> Ptr <apr_pool_t> -> Ptr <apr_dbd_t> -> Ptr (Ptr <apr_dbd_results_t>) -> Ptr <apr_dbd_prepared_t> -> CInt -> Ptr (Ptr ()) -> IO CInt
+-- FIXME: apr_dbd_pvbquery takes varargs
+-- FIXME: apr_dbd_pvbselect takes varargs
+
+#ccall apr_dbd_datum_get, Ptr <apr_dbd_driver_t> -> Ptr <apr_dbd_row_t> -> CInt -> <apr_dbd_type_e> -> Ptr () -> IO <apr_status_t>