forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GDALSetAdbcDriverInitFunc() and use it in OGR ADBC driver
Also no longer make AdbcDriverManager a requirement
- Loading branch information
1 parent
b9ef134
commit ecf243d
Showing
14 changed files
with
2,629 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/****************************************************************************** | ||
* Name: gdal_adbc.h | ||
* Project: GDAL Core | ||
* Purpose: GDAL Core ADBC related declarations. | ||
* Author: Even Rouault <even dot rouault at spatialys.com> | ||
* | ||
****************************************************************************** | ||
* Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com> | ||
* Copyright (c) 2024, Dewey Dunnington <dewey@voltrondata.com> | ||
* | ||
* SPDX-License-Identifier: MIT | ||
****************************************************************************/ | ||
|
||
#include "cpl_port.h" | ||
#include "gdal_adbc.h" | ||
|
||
//! ADBC driver initialization function | ||
static GDALAdbcLoadDriverFunc GDALAdbcLoadDriver = nullptr; | ||
|
||
/************************************************************************/ | ||
/* GDALSetAdbcLoadDriverOverride() */ | ||
/************************************************************************/ | ||
|
||
/** When set, it is used by the OGR ADBC driver to populate AdbcDriver | ||
* callbacks. This provides an embedding application the opportunity to | ||
* locate an up-to-date version of a driver or to bundle a driver not | ||
* available at the system level. | ||
* | ||
* Setting it to NULL resets to the the default behaviour of the ADBC driver, | ||
* which is use AdbcLoadDriver() from arrow-adbc/adbc_driver_manager.h or | ||
* to error if the OGR ADBC driver was not built against a system driver | ||
* manager. | ||
*/ | ||
void GDALSetAdbcLoadDriverOverride(GDALAdbcLoadDriverFunc init_func) | ||
{ | ||
GDALAdbcLoadDriver = init_func; | ||
} | ||
|
||
/************************************************************************/ | ||
/* GDALGetAdbcLoadDriverOverride() */ | ||
/************************************************************************/ | ||
|
||
/** Gets the ADBC driver load function. This will be NULL if an explicit | ||
* override was not specified. | ||
*/ | ||
GDALAdbcLoadDriverFunc GDALGetAdbcLoadDriverOverride() | ||
{ | ||
return GDALAdbcLoadDriver; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/****************************************************************************** | ||
* Name: gdal_adbc.h | ||
* Project: GDAL Core | ||
* Purpose: GDAL Core ADBC related declarations. | ||
* Author: Even Rouault <even dot rouault at spatialys.com> | ||
* | ||
****************************************************************************** | ||
* Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com> | ||
* Copyright (c) 2024, Dewey Dunnington <dewey@voltrondata.com> | ||
* | ||
* SPDX-License-Identifier: MIT | ||
****************************************************************************/ | ||
|
||
#ifndef GDAL_ADBC_H_INCLUDED | ||
#define GDAL_ADBC_H_INCLUDED | ||
|
||
/** | ||
* \file gdal_adbc.h | ||
* | ||
* C GDAL entry points for Arrow Database Connectivity (ADBC) | ||
* | ||
* These functions provide an opportunity to override the mechanism | ||
* that locates and loads ADBC drivers, or provide one if GDAL was | ||
* not built with ADBC driver manager support. | ||
* | ||
* \since GDAL 3.11 | ||
*/ | ||
|
||
#include "cpl_port.h" | ||
|
||
#include <stdint.h> | ||
|
||
CPL_C_START | ||
|
||
typedef uint8_t (*GDALAdbcLoadDriverFunc)(const char *driver_name, | ||
const char *entrypoint, int version, | ||
void *driver, void *error); | ||
|
||
void CPL_DLL GDALSetAdbcLoadDriverOverride(GDALAdbcLoadDriverFunc init_func); | ||
|
||
GDALAdbcLoadDriverFunc CPL_DLL GDALGetAdbcLoadDriverOverride(void); | ||
|
||
CPL_C_END | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.