The driver manager is a library that implements the ADBC API by delegating to dynamically-loaded drivers. This allows applications to use multiple drivers simultaneously, and decouple themselves from the specific driver.
To create a database, use the
AdbcDatabase API as usual,
but during initialization, provide two additional parameters in
addition to the driver-specific connection parameters:
driver must be the name of a library
to load, or the path to a library to load.
provided, should be the name of the symbol that serves as the ADBC
/* Ignoring error handling */ struct AdbcDatabase database; memset(&database, 0, sizeof(database)); AdbcDatabaseNew(&database, NULL); /* On Linux: loads libadbc_driver_sqlite.so * On MacOS: loads libadbc_driver_sqlite.dylib * On Windows: loads adbc_driver_sqlite.dll */ AdbcDatabaseSetOption(&database, "driver", "adbc_driver_sqlite", NULL); /* Set additional options for the specific driver, if needed */ /* Initialize the database */ AdbcDatabaseInit(&database, NULL); /* Create connections as usual */
The driver manager includes a few additional functions beyond the ADBC API. See the API reference: adbc_driver_manager.h.