ADBC
Arrow Database Connectivity
Loading...
Searching...
No Matches
adbc_driver_manager.h
Go to the documentation of this file.
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
22
23#pragma once
24
25#include <arrow-adbc/adbc.h>
26#include <stdint.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32#ifndef ADBC_DRIVER_MANAGER_H
33#define ADBC_DRIVER_MANAGER_H
34
35typedef uint32_t AdbcLoadFlags;
36
37#define ADBC_LOAD_FLAG_SEARCH_ENV 1
38#define ADBC_LOAD_FLAG_SEARCH_USER 2
39#define ADBC_LOAD_FLAG_SEARCH_SYSTEM 4
40#define ADBC_LOAD_FLAG_ALLOW_RELATIVE_PATHS 8
41
42#define ADBC_LOAD_FLAG_DEFAULT \
43 (ADBC_LOAD_FLAG_SEARCH_ENV | ADBC_LOAD_FLAG_SEARCH_USER | \
44 ADBC_LOAD_FLAG_SEARCH_SYSTEM | ADBC_LOAD_FLAG_ALLOW_RELATIVE_PATHS)
45
62ADBC_EXPORT
63AdbcStatusCode AdbcLoadDriver(const char* driver_name, const char* entrypoint,
64 int version, void* driver, struct AdbcError* error);
65
108ADBC_EXPORT
109AdbcStatusCode AdbcFindLoadDriver(const char* driver_name, const char* entrypoint,
110 const int version, const AdbcLoadFlags load_options,
111 const char* additional_search_path_list, void* driver,
112 struct AdbcError* error);
113
126ADBC_EXPORT
128 void* driver, struct AdbcError* error);
129
137ADBC_EXPORT
139 AdbcDriverInitFunc init_func,
140 struct AdbcError* error);
141
152ADBC_EXPORT
154 AdbcLoadFlags flags,
155 struct AdbcError* error);
156
170ADBC_EXPORT
172 struct AdbcDatabase* database, const char* path_list, struct AdbcError* error);
173
175ADBC_EXPORT
177
202
204struct ADBC_EXPORT AdbcConnectionProfile {
209
211 void (*release)(struct AdbcConnectionProfile* profile);
212
216 // can be reusable across drivers, then the profile does not need to specify
226 const char** driver_name, AdbcDriverInitFunc* init_func,
227 struct AdbcError* error);
228
247 AdbcStatusCode (*GetOptions)(struct AdbcConnectionProfile* profile, const char*** keys,
248 const char*** values, size_t* num_options,
249 struct AdbcError* error);
250
268 const char*** keys, const int64_t** values,
269 size_t* num_options, struct AdbcError* error);
270
289 const char*** keys, const double** values,
290 size_t* num_options, struct AdbcError* error);
291};
292
303 const char* profile_name, const char* additional_search_path_list,
304 struct AdbcConnectionProfile* out, struct AdbcError* error);
305
339ADBC_EXPORT
341 struct AdbcDatabase* database, AdbcConnectionProfileProvider provider,
342 struct AdbcError* error);
343
350ADBC_EXPORT
352 const char* additional_search_path_list,
353 struct AdbcConnectionProfile* out,
354 struct AdbcError* error);
355
357
358#endif // ADBC_DRIVER_MANAGER_H
359
360#ifdef __cplusplus
361}
362#endif
AdbcStatusCode AdbcDriverManagerDatabaseSetLoadFlags(struct AdbcDatabase *database, AdbcLoadFlags flags, struct AdbcError *error)
Set the load flags for the driver manager.
const char * AdbcStatusCodeMessage(AdbcStatusCode code)
Get a human-friendly description of a status code.
AdbcStatusCode AdbcFindLoadDriver(const char *driver_name, const char *entrypoint, const int version, const AdbcLoadFlags load_options, const char *additional_search_path_list, void *driver, struct AdbcError *error)
Common entry point to search for and load a driver or manifest.
AdbcStatusCode AdbcLoadDriverFromInitFunc(AdbcDriverInitFunc init_func, int version, void *driver, struct AdbcError *error)
Common entry point for drivers via the driver manager.
AdbcStatusCode AdbcLoadDriver(const char *driver_name, const char *entrypoint, int version, void *driver, struct AdbcError *error)
Common entry point for drivers via the driver manager.
AdbcStatusCode AdbcDriverManagerDatabaseSetInitFunc(struct AdbcDatabase *database, AdbcDriverInitFunc init_func, struct AdbcError *error)
Set the AdbcDriverInitFunc to use.
AdbcStatusCode AdbcDriverManagerDatabaseSetAdditionalSearchPathList(struct AdbcDatabase *database, const char *path_list, struct AdbcError *error)
Set an additional manifest search path list for the driver manager.
An instance of a database.
Definition adbc.h:860
AdbcStatusCode(* GetOptions)(struct AdbcConnectionProfile *profile, const char ***keys, const char ***values, size_t *num_options, struct AdbcError *error)
Get the string options specified by the profile.
Definition adbc_driver_manager.h:247
void(* release)(struct AdbcConnectionProfile *profile)
Release the profile and perform any cleanup.
Definition adbc_driver_manager.h:211
AdbcStatusCode(* GetIntOptions)(struct AdbcConnectionProfile *profile, const char ***keys, const int64_t **values, size_t *num_options, struct AdbcError *error)
Get the integer options specified by the profile.
Definition adbc_driver_manager.h:267
void * private_data
Opaque implementation-defined state. This field is NULL if the profile is uninitialized/freed (but it...
Definition adbc_driver_manager.h:208
AdbcStatusCode(* GetDoubleOptions)(struct AdbcConnectionProfile *profile, const char ***keys, const double **values, size_t *num_options, struct AdbcError *error)
Get the double options specified by the profile.
Definition adbc_driver_manager.h:288
AdbcStatusCode(* GetDriverName)(struct AdbcConnectionProfile *profile, const char **driver_name, AdbcDriverInitFunc *init_func, struct AdbcError *error)
Get the driver to use as specified by this profile.
Definition adbc_driver_manager.h:225
AdbcStatusCode AdbcProfileProviderFilesystem(const char *profile_name, const char *additional_search_path_list, struct AdbcConnectionProfile *out, struct AdbcError *error)
Default Filesystem-based profile provider for the driver manager.
AdbcStatusCode AdbcDriverManagerDatabaseSetProfileProvider(struct AdbcDatabase *database, AdbcConnectionProfileProvider provider, struct AdbcError *error)
Set a custom connection profile provider for the driver manager.
AdbcStatusCode(* AdbcConnectionProfileProvider)(const char *profile_name, const char *additional_search_path_list, struct AdbcConnectionProfile *out, struct AdbcError *error)
Common definition for a connection profile provider.
Definition adbc_driver_manager.h:302
Abstract interface for connection profile providers.
Definition adbc_driver_manager.h:204
AdbcStatusCode(* AdbcDriverInitFunc)(int version, void *driver, struct AdbcError *error)
Common entry point for drivers via the driver manager (which uses dlopen(3)/LoadLibrary)....
Definition adbc.h:2404
uint8_t AdbcStatusCode
Error codes for operations that may fail.
Definition adbc.h:176
A detailed error message for an operation.
Definition adbc.h:283