ADBC
Arrow Database Connectivity
Loading...
Searching...
No Matches
Driver Initialization

Classes

struct  AdbcDriver
 An instance of an initialized database driver. More...
 

Macros

#define ADBC_DRIVER_1_0_0_SIZE   (offsetof(struct AdbcDriver, ErrorGetDetailCount))
 The size of the AdbcDriver structure in ADBC 1.0.0. Drivers written for ADBC 1.1.0 and later should never touch more than this portion of an AdbcDriver struct when given ADBC_VERSION_1_0_0.
 
#define ADBC_DRIVER_1_1_0_SIZE   (sizeof(struct AdbcDriver))
 The size of the AdbcDriver structure in ADBC 1.1.0. Drivers written for ADBC 1.1.0 and later should never touch more than this portion of an AdbcDriver struct when given ADBC_VERSION_1_1_0.
 

Typedefs

typedef AdbcStatusCode(* AdbcDriverInitFunc) (int version, void *driver, struct AdbcError *error)
 Common entry point for drivers via the driver manager (which uses dlopen(3)/LoadLibrary). The driver manager is told to load a library and call a function of this type to load the driver.
 

Detailed Description

These functions are intended to help support integration between a driver and the driver manager.


Class Documentation

◆ AdbcDriver

struct AdbcDriver

An instance of an initialized database driver.

This provides a common interface for vendor-specific driver initialization routines. Drivers should populate this struct, and applications can call ADBC functions through this struct, without worrying about multiple definitions of the same symbol.

Public Attributes

void * private_data
 Opaque driver-defined state. This field is NULL if the driver is unintialized/freed (but it need not have a value even if the driver is initialized).
 
void * private_manager
 Opaque driver manager-defined state. This field is NULL if the driver is unintialized/freed (but it need not have a value even if the driver is initialized).
 
AdbcStatusCode(* release )(struct AdbcDriver *driver, struct AdbcError *error)
 Release the driver and perform any cleanup.
 
AdbcStatusCode(* DatabaseInit )(struct AdbcDatabase *, struct AdbcError *)
 
AdbcStatusCode(* DatabaseNew )(struct AdbcDatabase *, struct AdbcError *)
 
AdbcStatusCode(* DatabaseSetOption )(struct AdbcDatabase *, const char *, const char *, struct AdbcError *)
 
AdbcStatusCode(* DatabaseRelease )(struct AdbcDatabase *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionCommit )(struct AdbcConnection *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetInfo )(struct AdbcConnection *, const uint32_t *, size_t, struct ArrowArrayStream *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetObjects )(struct AdbcConnection *, int, const char *, const char *, const char *, const char **, const char *, struct ArrowArrayStream *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetTableSchema )(struct AdbcConnection *, const char *, const char *, const char *, struct ArrowSchema *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetTableTypes )(struct AdbcConnection *, struct ArrowArrayStream *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionInit )(struct AdbcConnection *, struct AdbcDatabase *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionNew )(struct AdbcConnection *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionSetOption )(struct AdbcConnection *, const char *, const char *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionReadPartition )(struct AdbcConnection *, const uint8_t *, size_t, struct ArrowArrayStream *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionRelease )(struct AdbcConnection *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionRollback )(struct AdbcConnection *, struct AdbcError *)
 
AdbcStatusCode(* StatementBind )(struct AdbcStatement *, struct ArrowArray *, struct ArrowSchema *, struct AdbcError *)
 
AdbcStatusCode(* StatementBindStream )(struct AdbcStatement *, struct ArrowArrayStream *, struct AdbcError *)
 
AdbcStatusCode(* StatementExecuteQuery )(struct AdbcStatement *, struct ArrowArrayStream *, int64_t *, struct AdbcError *)
 
AdbcStatusCode(* StatementExecutePartitions )(struct AdbcStatement *, struct ArrowSchema *, struct AdbcPartitions *, int64_t *, struct AdbcError *)
 
AdbcStatusCode(* StatementGetParameterSchema )(struct AdbcStatement *, struct ArrowSchema *, struct AdbcError *)
 
AdbcStatusCode(* StatementNew )(struct AdbcConnection *, struct AdbcStatement *, struct AdbcError *)
 
AdbcStatusCode(* StatementPrepare )(struct AdbcStatement *, struct AdbcError *)
 
AdbcStatusCode(* StatementRelease )(struct AdbcStatement *, struct AdbcError *)
 
AdbcStatusCode(* StatementSetOption )(struct AdbcStatement *, const char *, const char *, struct AdbcError *)
 
AdbcStatusCode(* StatementSetSqlQuery )(struct AdbcStatement *, const char *, struct AdbcError *)
 
AdbcStatusCode(* StatementSetSubstraitPlan )(struct AdbcStatement *, const uint8_t *, size_t, struct AdbcError *)
 
int(* ErrorGetDetailCount )(const struct AdbcError *error)
 
struct AdbcErrorDetail(* ErrorGetDetail )(const struct AdbcError *error, int index)
 
const struct AdbcError *(* ErrorFromArrayStream )(struct ArrowArrayStream *stream, AdbcStatusCode *status)
 
AdbcStatusCode(* DatabaseGetOption )(struct AdbcDatabase *, const char *, char *, size_t *, struct AdbcError *)
 
AdbcStatusCode(* DatabaseGetOptionBytes )(struct AdbcDatabase *, const char *, uint8_t *, size_t *, struct AdbcError *)
 
AdbcStatusCode(* DatabaseGetOptionDouble )(struct AdbcDatabase *, const char *, double *, struct AdbcError *)
 
AdbcStatusCode(* DatabaseGetOptionInt )(struct AdbcDatabase *, const char *, int64_t *, struct AdbcError *)
 
AdbcStatusCode(* DatabaseSetOptionBytes )(struct AdbcDatabase *, const char *, const uint8_t *, size_t, struct AdbcError *)
 
AdbcStatusCode(* DatabaseSetOptionDouble )(struct AdbcDatabase *, const char *, double, struct AdbcError *)
 
AdbcStatusCode(* DatabaseSetOptionInt )(struct AdbcDatabase *, const char *, int64_t, struct AdbcError *)
 
AdbcStatusCode(* ConnectionCancel )(struct AdbcConnection *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetOption )(struct AdbcConnection *, const char *, char *, size_t *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetOptionBytes )(struct AdbcConnection *, const char *, uint8_t *, size_t *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetOptionDouble )(struct AdbcConnection *, const char *, double *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetOptionInt )(struct AdbcConnection *, const char *, int64_t *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetStatistics )(struct AdbcConnection *, const char *, const char *, const char *, char, struct ArrowArrayStream *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionGetStatisticNames )(struct AdbcConnection *, struct ArrowArrayStream *, struct AdbcError *)
 
AdbcStatusCode(* ConnectionSetOptionBytes )(struct AdbcConnection *, const char *, const uint8_t *, size_t, struct AdbcError *)
 
AdbcStatusCode(* ConnectionSetOptionDouble )(struct AdbcConnection *, const char *, double, struct AdbcError *)
 
AdbcStatusCode(* ConnectionSetOptionInt )(struct AdbcConnection *, const char *, int64_t, struct AdbcError *)
 
AdbcStatusCode(* StatementCancel )(struct AdbcStatement *, struct AdbcError *)
 
AdbcStatusCode(* StatementExecuteSchema )(struct AdbcStatement *, struct ArrowSchema *, struct AdbcError *)
 
AdbcStatusCode(* StatementGetOption )(struct AdbcStatement *, const char *, char *, size_t *, struct AdbcError *)
 
AdbcStatusCode(* StatementGetOptionBytes )(struct AdbcStatement *, const char *, uint8_t *, size_t *, struct AdbcError *)
 
AdbcStatusCode(* StatementGetOptionDouble )(struct AdbcStatement *, const char *, double *, struct AdbcError *)
 
AdbcStatusCode(* StatementGetOptionInt )(struct AdbcStatement *, const char *, int64_t *, struct AdbcError *)
 
AdbcStatusCode(* StatementSetOptionBytes )(struct AdbcStatement *, const char *, const uint8_t *, size_t, struct AdbcError *)
 
AdbcStatusCode(* StatementSetOptionDouble )(struct AdbcStatement *, const char *, double, struct AdbcError *)
 
AdbcStatusCode(* StatementSetOptionInt )(struct AdbcStatement *, const char *, int64_t, struct AdbcError *)
 

Member Data Documentation

◆ private_data

void* AdbcDriver::private_data

Opaque driver-defined state. This field is NULL if the driver is unintialized/freed (but it need not have a value even if the driver is initialized).

◆ private_manager

void* AdbcDriver::private_manager

Opaque driver manager-defined state. This field is NULL if the driver is unintialized/freed (but it need not have a value even if the driver is initialized).

◆ release

AdbcStatusCode(* AdbcDriver::release) (struct AdbcDriver *driver, struct AdbcError *error)

Release the driver and perform any cleanup.

This is an embedded callback to make it easier for the driver manager and driver to cooperate.

Macro Definition Documentation

◆ ADBC_DRIVER_1_0_0_SIZE

#define ADBC_DRIVER_1_0_0_SIZE   (offsetof(struct AdbcDriver, ErrorGetDetailCount))

The size of the AdbcDriver structure in ADBC 1.0.0. Drivers written for ADBC 1.1.0 and later should never touch more than this portion of an AdbcDriver struct when given ADBC_VERSION_1_0_0.

Since
ADBC API revision 1.1.0

◆ ADBC_DRIVER_1_1_0_SIZE

#define ADBC_DRIVER_1_1_0_SIZE   (sizeof(struct AdbcDriver))

The size of the AdbcDriver structure in ADBC 1.1.0. Drivers written for ADBC 1.1.0 and later should never touch more than this portion of an AdbcDriver struct when given ADBC_VERSION_1_1_0.

Since
ADBC API revision 1.1.0

Typedef Documentation

◆ AdbcDriverInitFunc

typedef AdbcStatusCode(* AdbcDriverInitFunc) (int version, void *driver, struct AdbcError *error)

Common entry point for drivers via the driver manager (which uses dlopen(3)/LoadLibrary). The driver manager is told to load a library and call a function of this type to load the driver.

Although drivers may choose any name for this function, the recommended name is "AdbcDriverInit", or a name derived from the name of the driver's shared library as follows: remove the 'lib' prefix (on Unix systems) and all file extensions, then PascalCase the driver name, append Init, and prepend Adbc (if not already there). For example:

  • libadbc_driver_sqlite.so.2.0.0 -> AdbcDriverSqliteInit
  • adbc_driver_sqlite.dll -> AdbcDriverSqliteInit
  • proprietary_driver.dll -> AdbcProprietaryDriverInit
Parameters
[in]versionThe ADBC revision to attempt to initialize (see ADBC_VERSION_1_0_0).
[out]driverThe table of function pointers to initialize. Should be a pointer to the appropriate struct for the given version (see the documentation for the version).
[out]errorAn optional location to return an error message if necessary.
Returns
ADBC_STATUS_OK if the driver was initialized, or ADBC_STATUS_NOT_IMPLEMENTED if the version is not supported. In that case, clients may retry with a different version.