This is an automated email from the ASF dual-hosted git repository.
lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 8fb7c2f3e refactor(c)!: Updated include/install paths for adbc.h
(#1965)
8fb7c2f3e is described below
commit 8fb7c2f3ea4205120574c8e36cc35208ffd361de
Author: William Ayd <[email protected]>
AuthorDate: Tue Jul 30 02:20:26 2024 -0400
refactor(c)!: Updated include/install paths for adbc.h (#1965)
closes https://github.com/apache/arrow-adbc/issues/1150
---------
Co-authored-by: Dewey Dunnington <[email protected]>
---
.github/workflows/integration.yml | 2 -
.github/workflows/native-unix.yml | 2 -
.github/workflows/native-windows.yml | 2 -
.github/workflows/packaging.yml | 1 -
.github/workflows/r-basic.yml | 1 -
.github/workflows/r-check.yml | 12 ++++
.github/workflows/r-standard.yml | 1 -
c/CMakeLists.txt | 7 ++
c/apidoc/Doxyfile | 2 +-
c/driver/bigquery/CMakeLists.txt | 4 +-
c/driver/bigquery/bigquery_test.cc | 2 +-
c/driver/common/CMakeLists.txt | 5 +-
c/driver/common/driver_base.h | 2 +-
c/driver/common/driver_test.cc | 2 +-
c/driver/common/meson.build | 4 +-
c/driver/common/utils.c | 2 +-
c/driver/common/utils.h | 2 +-
c/driver/flightsql/CMakeLists.txt | 5 +-
c/driver/flightsql/dremio_flightsql_test.cc | 2 +-
c/driver/flightsql/meson.build | 2 +-
c/driver/flightsql/sqlite_flightsql_test.cc | 2 +-
c/driver/framework/CMakeLists.txt | 2 +-
c/driver/framework/base_connection.h | 2 +-
c/driver/framework/base_database.h | 2 +-
c/driver/framework/base_driver.h | 2 +-
c/driver/framework/catalog.h | 2 +-
c/driver/framework/meson.build | 2 +-
c/driver/framework/status.h | 2 +-
c/driver/postgresql/CMakeLists.txt | 14 ++--
c/driver/postgresql/connection.cc | 2 +-
c/driver/postgresql/connection.h | 2 +-
c/driver/postgresql/database.cc | 2 +-
c/driver/postgresql/database.h | 2 +-
c/driver/postgresql/error.h | 2 +-
c/driver/postgresql/meson.build | 4 +-
c/driver/postgresql/postgres_util.h | 2 +-
c/driver/postgresql/postgresql.cc | 2 +-
c/driver/postgresql/postgresql_benchmark.cc | 2 +-
c/driver/postgresql/postgresql_test.cc | 2 +-
c/driver/postgresql/result_helper.h | 2 +-
c/driver/postgresql/statement.cc | 2 +-
c/driver/postgresql/statement.h | 2 +-
c/driver/snowflake/CMakeLists.txt | 7 +-
c/driver/snowflake/meson.build | 2 +-
c/driver/snowflake/snowflake_test.cc | 2 +-
c/driver/sqlite/CMakeLists.txt | 8 +--
c/driver/sqlite/meson.build | 4 +-
c/driver/sqlite/sqlite.cc | 2 +-
c/driver/sqlite/sqlite_test.cc | 2 +-
c/driver/sqlite/statement_reader.c | 2 +-
c/driver/sqlite/statement_reader.h | 2 +-
c/driver_manager/CMakeLists.txt | 4 +-
c/driver_manager/adbc_driver_manager.cc | 4 +-
c/driver_manager/adbc_driver_manager_test.cc | 4 +-
c/driver_manager/adbc_version_100.h | 2 +-
.../adbc_version_100_compatibility_test.cc | 4 +-
c/driver_manager/meson.build | 2 +-
c/{driver/postgresql/error.h => include/adbc.h} | 28 ++------
.../error.h => include/adbc_driver_manager.h} | 28 ++------
{go/adbc/drivermgr => c/include/arrow-adbc}/adbc.h | 2 +-
.../include/arrow-adbc}/adbc_driver_manager.h | 2 +-
c/integration/duckdb/CMakeLists.txt | 2 +-
c/integration/duckdb/duckdb_test.cc | 4 +-
c/meson.build | 7 +-
c/validation/CMakeLists.txt | 6 +-
c/validation/adbc_validation.cc | 2 +-
c/validation/adbc_validation.h | 2 +-
c/validation/adbc_validation_connection.cc | 2 +-
c/validation/adbc_validation_database.cc | 2 +-
c/validation/adbc_validation_statement.cc | 2 +-
c/validation/adbc_validation_util.cc | 2 +-
c/validation/adbc_validation_util.h | 2 +-
c/validation/meson.build | 4 +-
ci/conda/meta.yaml | 8 +--
.../debian/libadbc-driver-manager-dev.install | 1 +
ci/linux-packages/yum/apache-arrow-adbc.spec.in | 1 +
csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs | 2 +-
dev/release/rat_exclude_files.txt | 2 +-
docs/source/cpp/recipe/quickstart.cc | 2 +-
docs/source/driver/flight_sql.rst | 2 +-
docs/source/driver/postgresql.rst | 2 +-
docs/source/driver/snowflake.rst | 2 +-
docs/source/driver/sqlite.rst | 2 +-
docs/source/format/how_manager.rst | 4 +-
glib/adbc-glib/connection-raw.h | 2 +-
glib/adbc-glib/database-raw.h | 2 +-
glib/adbc-glib/error-raw.h | 2 +-
glib/adbc-glib/error.c | 2 +-
glib/adbc-glib/statement-raw.h | 2 +-
glib/meson.build | 5 +-
go/adbc/drivermgr/adbc_driver_manager.cc | 4 +-
adbc.h => go/adbc/drivermgr/arrow-adbc/adbc.h | 0
.../drivermgr/arrow-adbc}/adbc_driver_manager.h | 2 +-
go/adbc/drivermgr/wrapper.go | 2 +-
go/adbc/pkg/_tmpl/driver.go.tmpl | 2 +-
go/adbc/pkg/_tmpl/utils.h.tmpl | 2 +-
go/adbc/pkg/bigquery/driver.go | 2 +-
go/adbc/pkg/bigquery/utils.h | 2 +-
go/adbc/pkg/flightsql/driver.go | 2 +-
go/adbc/pkg/flightsql/utils.h | 2 +-
go/adbc/pkg/panicdummy/driver.go | 2 +-
go/adbc/pkg/panicdummy/utils.h | 2 +-
go/adbc/pkg/snowflake/driver.go | 2 +-
go/adbc/pkg/snowflake/utils.h | 2 +-
python/adbc_driver_manager/.gitignore | 1 +
python/adbc_driver_manager/MANIFEST.in | 4 +-
.../adbc_driver_manager/_lib.pxd | 4 +-
python/adbc_driver_manager/setup.py | 24 ++++---
r/adbcdrivermanager/bootstrap.R | 29 +++++++-
r/adbcdrivermanager/configure | 21 +-----
r/adbcdrivermanager/src/driver_test.cc | 2 +-
r/adbcdrivermanager/src/error.cc | 4 +-
r/adbcdrivermanager/src/options.cc | 2 +-
r/adbcdrivermanager/src/radbc.cc | 4 +-
r/adbcdrivermanager/src/radbc.h | 2 +-
r/adbcflightsql/bootstrap.R | 4 +-
r/adbcpostgresql/bootstrap.R | 84 ++++------------------
r/adbcpostgresql/configure | 11 ---
r/adbcpostgresql/src/.gitignore | 3 +-
r/adbcpostgresql/src/c/driver/common/.gitignore | 20 ------
r/adbcpostgresql/src/c/driver/framework/.gitignore | 20 ------
.../src/c/driver/postgresql/.gitignore | 30 --------
.../src/c/driver/postgresql/copy/.gitignore | 20 ------
.../src/c/vendor/fmt/include/fmt/.gitignore | 31 --------
r/adbcpostgresql/src/c/vendor/nanoarrow/.gitignore | 20 ------
r/adbcpostgresql/src/init.cc | 2 +-
r/adbcsnowflake/bootstrap.R | 4 +-
r/adbcsqlite/bootstrap.R | 77 ++++----------------
r/adbcsqlite/configure | 11 ---
r/adbcsqlite/src/.gitignore | 3 +-
r/adbcsqlite/src/c/driver/common/.gitignore | 19 -----
r/adbcsqlite/src/c/driver/framework/.gitignore | 27 -------
r/adbcsqlite/src/c/driver/sqlite/.gitignore | 19 -----
r/adbcsqlite/src/c/vendor/fmt/.gitignore | 22 ------
.../src/c/vendor/fmt/include/fmt/.gitignore | 30 --------
r/adbcsqlite/src/c/vendor/fmt/src/.gitignore | 19 -----
.../src/c/vendor/fmt/support/cmake/.gitignore | 20 ------
r/adbcsqlite/src/c/vendor/nanoarrow/.gitignore | 19 -----
r/adbcsqlite/src/c/vendor/sqlite3/.gitignore | 18 -----
r/adbcsqlite/src/init.cc | 2 +-
140 files changed, 254 insertions(+), 717 deletions(-)
diff --git a/.github/workflows/integration.yml
b/.github/workflows/integration.yml
index 784b535ed..b6882f5c7 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -22,7 +22,6 @@ on:
branches:
- main
paths:
- - "adbc.h"
- "c/**"
- "ci/**"
- "go/**"
@@ -30,7 +29,6 @@ on:
- ".github/workflows/integration.yml"
push:
paths:
- - "adbc.h"
- "c/**"
- "ci/**"
- "go/**"
diff --git a/.github/workflows/native-unix.yml
b/.github/workflows/native-unix.yml
index 68f37cdf8..687d62e80 100644
--- a/.github/workflows/native-unix.yml
+++ b/.github/workflows/native-unix.yml
@@ -22,7 +22,6 @@ on:
branches:
- main
paths:
- - "adbc.h"
- "c/**"
- "ci/**"
- "docs/**"
@@ -33,7 +32,6 @@ on:
- ".github/workflows/native-unix.yml"
push:
paths:
- - "adbc.h"
- "c/**"
- "ci/**"
- "docs/**"
diff --git a/.github/workflows/native-windows.yml
b/.github/workflows/native-windows.yml
index e78403d03..331671c13 100644
--- a/.github/workflows/native-windows.yml
+++ b/.github/workflows/native-windows.yml
@@ -22,7 +22,6 @@ on:
branches:
- main
paths:
- - "adbc.h"
- "c/**"
- "ci/**"
- "glib/**"
@@ -32,7 +31,6 @@ on:
- ".github/workflows/native-windows.yml"
push:
paths:
- - "adbc.h"
- "c/**"
- "ci/**"
- "glib/**"
diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml
index 088acb29d..7bf5f90b9 100644
--- a/.github/workflows/packaging.yml
+++ b/.github/workflows/packaging.yml
@@ -23,7 +23,6 @@ on:
- main
paths:
- ".env"
- - "adbc.h"
- "c/**"
- "ci/**"
- "glib/**"
diff --git a/.github/workflows/r-basic.yml b/.github/workflows/r-basic.yml
index e698b34bb..5320e794e 100644
--- a/.github/workflows/r-basic.yml
+++ b/.github/workflows/r-basic.yml
@@ -23,7 +23,6 @@ on:
branches:
- main
paths:
- - "adbc.h"
- "c/**"
- "go/adbc/driver/**"
- "go/adbc/pkg/**"
diff --git a/.github/workflows/r-check.yml b/.github/workflows/r-check.yml
index 0b368ca33..422d4cda3 100644
--- a/.github/workflows/r-check.yml
+++ b/.github/workflows/r-check.yml
@@ -58,6 +58,18 @@ jobs:
PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:$(brew --prefix
libpq)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV
+ # Usually, pak::pkg_install() will run bootstrap.R if it is included and
is declared;
+ # however, this doesn't work for local:: for some reason (which is what
+ # setup-r-dependencies uses under the hood)
+ - name: Bootstrap R Package
+ run: |
+ pushd r/adbcdrivermanager
+ Rscript bootstrap.R
+ popd
+ pushd "r/${{ inputs.pkg }}"
+ Rscript bootstrap.R
+ popd
+
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, local::../adbcdrivermanager
diff --git a/.github/workflows/r-standard.yml b/.github/workflows/r-standard.yml
index 9a5a49682..9cc8f7ac9 100644
--- a/.github/workflows/r-standard.yml
+++ b/.github/workflows/r-standard.yml
@@ -31,7 +31,6 @@ on:
branches:
- main
paths:
- - "adbc.h"
- "c/**"
- "go/adbc/driver/**"
- "go/adbc/pkg/**"
diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
index 3962e6374..f090aafd3 100644
--- a/c/CMakeLists.txt
+++ b/c/CMakeLists.txt
@@ -35,6 +35,10 @@ add_subdirectory(vendor/nanoarrow)
add_subdirectory(driver/common)
add_subdirectory(driver/framework)
+install(FILES "${REPOSITORY_ROOT}/c/include/adbc.h" DESTINATION include)
+install(FILES "${REPOSITORY_ROOT}/c/include/arrow-adbc/adbc.h"
+ DESTINATION include/arrow-adbc)
+
if(ADBC_BUILD_TESTS)
add_subdirectory(validation)
endif()
@@ -54,6 +58,9 @@ if(ADBC_DRIVER_FLIGHTSQL)
endif()
if(ADBC_DRIVER_MANAGER)
+ install(FILES "${REPOSITORY_ROOT}/c/include/adbc_driver_manager.h"
DESTINATION include)
+ install(FILES "${REPOSITORY_ROOT}/c/include/arrow-adbc/adbc_driver_manager.h"
+ DESTINATION include/arrow-adbc)
add_subdirectory(driver_manager)
endif()
diff --git a/c/apidoc/Doxyfile b/c/apidoc/Doxyfile
index df72a8bd0..204d9a697 100644
--- a/c/apidoc/Doxyfile
+++ b/c/apidoc/Doxyfile
@@ -891,7 +891,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = ../../adbc.h ../../README.md
../../c/driver_manager/adbc_driver_manager.h
+INPUT = ../../c/include/arrow-adbc/adbc.h ../../README.md
../../c/include/arrow-adbc/adbc_driver_manager.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/c/driver/bigquery/CMakeLists.txt b/c/driver/bigquery/CMakeLists.txt
index e1ceb7b98..fe3937878 100644
--- a/c/driver/bigquery/CMakeLists.txt
+++ b/c/driver/bigquery/CMakeLists.txt
@@ -61,8 +61,8 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-bigquery-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-bigquery-test SYSTEM
- PRIVATE ${REPOSITORY_ROOT}
- ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver
${REPOSITORY_ROOT}/c/driver/common)
diff --git a/c/driver/bigquery/bigquery_test.cc
b/c/driver/bigquery/bigquery_test.cc
index 0a9abe9a2..ae4ced886 100644
--- a/c/driver/bigquery/bigquery_test.cc
+++ b/c/driver/bigquery/bigquery_test.cc
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
diff --git a/c/driver/common/CMakeLists.txt b/c/driver/common/CMakeLists.txt
index 74d57406a..77999f39d 100644
--- a/c/driver/common/CMakeLists.txt
+++ b/c/driver/common/CMakeLists.txt
@@ -18,7 +18,7 @@
add_library(adbc_driver_common STATIC utils.c)
adbc_configure_target(adbc_driver_common)
set_target_properties(adbc_driver_common PROPERTIES POSITION_INDEPENDENT_CODE
ON)
-target_include_directories(adbc_driver_common PRIVATE "${REPOSITORY_ROOT}"
+target_include_directories(adbc_driver_common PRIVATE
"${REPOSITORY_ROOT}/c/include"
"${REPOSITORY_ROOT}/c/vendor")
if(ADBC_BUILD_TESTS)
@@ -35,6 +35,7 @@ if(ADBC_BUILD_TESTS)
nanoarrow)
target_compile_features(adbc-driver-common-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-common-test
- PRIVATE "${REPOSITORY_ROOT}"
"${REPOSITORY_ROOT}/c/vendor")
+ PRIVATE "${REPOSITORY_ROOT}/c/include"
+ "${REPOSITORY_ROOT}/c/vendor")
adbc_configure_target(adbc-driver-common-test)
endif()
diff --git a/c/driver/common/driver_base.h b/c/driver/common/driver_base.h
index 8f9fb7d07..0cfb05bd3 100644
--- a/c/driver/common/driver_base.h
+++ b/c/driver/common/driver_base.h
@@ -23,7 +23,7 @@
#include <utility>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
// This file defines a developer-friendly way to create an ADBC driver,
currently intended
// for testing the R driver manager. It handles errors, option
getting/setting, and
diff --git a/c/driver/common/driver_test.cc b/c/driver/common/driver_test.cc
index eaabc604a..85d24826c 100644
--- a/c/driver/common/driver_test.cc
+++ b/c/driver/common/driver_test.cc
@@ -18,7 +18,7 @@
#include <gtest/gtest.h>
#include <cstring>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include "driver_base.h"
// Self-contained version of the Handle
diff --git a/c/driver/common/meson.build b/c/driver/common/meson.build
index 8f3eb238c..a0999431c 100644
--- a/c/driver/common/meson.build
+++ b/c/driver/common/meson.build
@@ -18,7 +18,7 @@
adbc_common_lib = library(
'adbc_driver_common',
sources: ['utils.c'],
- include_directories: [root_dir],
+ include_directories: [include_dir],
dependencies: [nanoarrow_dep],
install: true,
)
@@ -28,7 +28,7 @@ if get_option('tests')
'adbc-driver-common-test',
'utils_test.cc',
'driver_test.cc',
- include_directories: [root_dir],
+ include_directories: [include_dir],
link_with: [adbc_common_lib],
dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep],
)
diff --git a/c/driver/common/utils.c b/c/driver/common/utils.c
index 2fee02a70..6daac6579 100644
--- a/c/driver/common/utils.c
+++ b/c/driver/common/utils.c
@@ -23,7 +23,7 @@
#include <stdlib.h>
#include <string.h>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
static size_t kErrorBufferSize = 1024;
diff --git a/c/driver/common/utils.h b/c/driver/common/utils.h
index cab5ddbe2..c61ecb0e9 100644
--- a/c/driver/common/utils.h
+++ b/c/driver/common/utils.h
@@ -22,7 +22,7 @@
#include <stdint.h>
#include <string.h>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include "nanoarrow/nanoarrow.h"
#ifdef __cplusplus
diff --git a/c/driver/flightsql/CMakeLists.txt
b/c/driver/flightsql/CMakeLists.txt
index a67df3a4d..1101b8243 100644
--- a/c/driver/flightsql/CMakeLists.txt
+++ b/c/driver/flightsql/CMakeLists.txt
@@ -35,7 +35,8 @@ add_go_lib("${REPOSITORY_ROOT}/go/adbc/pkg/flightsql/"
foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_include_directories(${LIB_TARGET} SYSTEM
- INTERFACE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
+ INTERFACE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
endforeach()
@@ -62,7 +63,7 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-flightsql-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-flightsql-test SYSTEM
- PRIVATE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
adbc_configure_target(adbc-driver-flightsql-test)
diff --git a/c/driver/flightsql/dremio_flightsql_test.cc
b/c/driver/flightsql/dremio_flightsql_test.cc
index c1b0a3ad0..f18344017 100644
--- a/c/driver/flightsql/dremio_flightsql_test.cc
+++ b/c/driver/flightsql/dremio_flightsql_test.cc
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
diff --git a/c/driver/flightsql/meson.build b/c/driver/flightsql/meson.build
index f9d781cd3..cac24d5cf 100644
--- a/c/driver/flightsql/meson.build
+++ b/c/driver/flightsql/meson.build
@@ -60,7 +60,7 @@ if get_option('tests')
'adbc-driver-flightsql-test',
'dremio_flightsql_test.cc',
'sqlite_flightsql_test.cc',
- include_directories: [root_dir, driver_dir],
+ include_directories: [include_dir, c_dir, driver_dir],
link_with: [
adbc_common_lib,
adbc_driver_flightsql_lib
diff --git a/c/driver/flightsql/sqlite_flightsql_test.cc
b/c/driver/flightsql/sqlite_flightsql_test.cc
index f08eeb884..454ea0297 100644
--- a/c/driver/flightsql/sqlite_flightsql_test.cc
+++ b/c/driver/flightsql/sqlite_flightsql_test.cc
@@ -20,7 +20,7 @@
#include <random>
#include <thread>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
diff --git a/c/driver/framework/CMakeLists.txt
b/c/driver/framework/CMakeLists.txt
index d67e5cec0..d6891aedb 100644
--- a/c/driver/framework/CMakeLists.txt
+++ b/c/driver/framework/CMakeLists.txt
@@ -21,7 +21,7 @@ add_library(adbc_driver_framework STATIC base_driver.cc
catalog.cc objects.cc)
adbc_configure_target(adbc_driver_framework)
set_target_properties(adbc_driver_framework PROPERTIES
POSITION_INDEPENDENT_CODE ON)
target_include_directories(adbc_driver_framework
- PRIVATE "${REPOSITORY_ROOT}" "${REPOSITORY_ROOT}/c/"
+ PRIVATE "${REPOSITORY_ROOT}/c/"
"${REPOSITORY_ROOT}/c/include"
"${REPOSITORY_ROOT}/c/vendor")
target_link_libraries(adbc_driver_framework PUBLIC adbc_driver_common fmt::fmt)
diff --git a/c/driver/framework/base_connection.h
b/c/driver/framework/base_connection.h
index f9ddc1c6a..0271639c6 100644
--- a/c/driver/framework/base_connection.h
+++ b/c/driver/framework/base_connection.h
@@ -24,7 +24,7 @@
#include <utility>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <nanoarrow/nanoarrow.h>
#include <nanoarrow/nanoarrow.hpp>
diff --git a/c/driver/framework/base_database.h
b/c/driver/framework/base_database.h
index 76901980c..5d043fc7e 100644
--- a/c/driver/framework/base_database.h
+++ b/c/driver/framework/base_database.h
@@ -20,7 +20,7 @@
#include <string_view>
#include <utility>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include "driver/framework/base_driver.h"
#include "driver/framework/status.h"
diff --git a/c/driver/framework/base_driver.h b/c/driver/framework/base_driver.h
index fcc385ac6..da6c39443 100644
--- a/c/driver/framework/base_driver.h
+++ b/c/driver/framework/base_driver.h
@@ -28,7 +28,7 @@
#include <variant>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <fmt/core.h>
#include <fmt/format.h>
diff --git a/c/driver/framework/catalog.h b/c/driver/framework/catalog.h
index a415765ca..39dcdcd73 100644
--- a/c/driver/framework/catalog.h
+++ b/c/driver/framework/catalog.h
@@ -25,7 +25,7 @@
#include <variant>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include "driver/framework/status.h"
diff --git a/c/driver/framework/meson.build b/c/driver/framework/meson.build
index 73d04dcd5..dfd32d261 100644
--- a/c/driver/framework/meson.build
+++ b/c/driver/framework/meson.build
@@ -22,7 +22,7 @@ adbc_framework_lib = library(
'catalog.cc',
'objects.cc',
],
- include_directories: [root_dir],
+ include_directories: [include_dir, c_dir],
link_with: [adbc_common_lib],
dependencies: [nanoarrow_dep, fmt_dep],
install: true,
diff --git a/c/driver/framework/status.h b/c/driver/framework/status.h
index b6375b8e8..ef81838d9 100644
--- a/c/driver/framework/status.h
+++ b/c/driver/framework/status.h
@@ -25,7 +25,7 @@
#include <variant>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <fmt/core.h>
/// \file status.h
diff --git a/c/driver/postgresql/CMakeLists.txt
b/c/driver/postgresql/CMakeLists.txt
index e8bbeac9e..8a004e0d0 100644
--- a/c/driver/postgresql/CMakeLists.txt
+++ b/c/driver/postgresql/CMakeLists.txt
@@ -57,8 +57,8 @@ add_arrow_lib(adbc_driver_postgresql
foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ADBC_EXPORTING)
target_include_directories(${LIB_TARGET} SYSTEM
- PRIVATE ${REPOSITORY_ROOT}
- ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
@@ -86,8 +86,8 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-postgresql-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-postgresql-test SYSTEM
- PRIVATE ${REPOSITORY_ROOT}
- ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
@@ -108,8 +108,8 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-postgresql-copy-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-postgresql-copy-test SYSTEM
- PRIVATE ${REPOSITORY_ROOT}
- ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
@@ -128,7 +128,7 @@ if(ADBC_BUILD_BENCHMARKS)
benchmark::benchmark)
# add_benchmark replaces _ with - when creating target
target_include_directories(postgresql-benchmark
- PRIVATE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
endif()
diff --git a/c/driver/postgresql/connection.cc
b/c/driver/postgresql/connection.cc
index 443e37aad..a918188bf 100644
--- a/c/driver/postgresql/connection.cc
+++ b/c/driver/postgresql/connection.cc
@@ -28,7 +28,7 @@
#include <utility>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
#include "database.h"
diff --git a/c/driver/postgresql/connection.h b/c/driver/postgresql/connection.h
index 5e45e90b7..2a3b59c5c 100644
--- a/c/driver/postgresql/connection.h
+++ b/c/driver/postgresql/connection.h
@@ -20,7 +20,7 @@
#include <cstdint>
#include <memory>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
#include "postgres_type.h"
diff --git a/c/driver/postgresql/database.cc b/c/driver/postgresql/database.cc
index 2837e8233..97242ad58 100644
--- a/c/driver/postgresql/database.cc
+++ b/c/driver/postgresql/database.cc
@@ -23,7 +23,7 @@
#include <utility>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
#include <nanoarrow/nanoarrow.h>
diff --git a/c/driver/postgresql/database.h b/c/driver/postgresql/database.h
index 6c3da58da..d246ea04a 100644
--- a/c/driver/postgresql/database.h
+++ b/c/driver/postgresql/database.h
@@ -21,7 +21,7 @@
#include <memory>
#include <string>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
#include "postgres_type.h"
diff --git a/c/driver/postgresql/error.h b/c/driver/postgresql/error.h
index 75c52b46c..825de97b9 100644
--- a/c/driver/postgresql/error.h
+++ b/c/driver/postgresql/error.h
@@ -19,7 +19,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
namespace adbcpq {
diff --git a/c/driver/postgresql/meson.build b/c/driver/postgresql/meson.build
index 4f24ec880..179cae59b 100644
--- a/c/driver/postgresql/meson.build
+++ b/c/driver/postgresql/meson.build
@@ -27,7 +27,7 @@ adbc_postgres_driver_lib = library(
'result_helper.cc',
'statement.cc',
],
- include_directories: [root_dir],
+ include_directories: [include_dir, c_dir],
link_with: [adbc_common_lib, adbc_framework_lib],
dependencies: [nanoarrow_dep, fmt_dep, libpq_dep],
)
@@ -62,7 +62,7 @@ if get_option('tests')
exc = executable(
'adbc-' + name + '-test',
sources: conf['sources'],
- include_directories: [root_dir, driver_dir],
+ include_directories: [include_dir, driver_dir, c_dir],
link_with: [
adbc_common_lib,
adbc_postgres_driver_lib,
diff --git a/c/driver/postgresql/postgres_util.h
b/c/driver/postgresql/postgres_util.h
index 6d42f85a2..fbd609848 100644
--- a/c/driver/postgresql/postgres_util.h
+++ b/c/driver/postgresql/postgres_util.h
@@ -33,7 +33,7 @@
#include <libkern/OSByteOrder.h>
#endif
-#include "adbc.h"
+#include "arrow-adbc/adbc.h"
namespace adbcpq {
diff --git a/c/driver/postgresql/postgresql.cc
b/c/driver/postgresql/postgresql.cc
index e1ffd543b..033c44648 100644
--- a/c/driver/postgresql/postgresql.cc
+++ b/c/driver/postgresql/postgresql.cc
@@ -20,7 +20,7 @@
#include <cstring>
#include <memory>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include "connection.h"
#include "database.h"
diff --git a/c/driver/postgresql/postgresql_benchmark.cc
b/c/driver/postgresql/postgresql_benchmark.cc
index a2373095f..aa22e033d 100644
--- a/c/driver/postgresql/postgresql_benchmark.cc
+++ b/c/driver/postgresql/postgresql_benchmark.cc
@@ -20,7 +20,7 @@
#include <benchmark/benchmark.h>
#include <nanoarrow/nanoarrow.hpp>
-#include "adbc.h"
+#include "arrow-adbc/adbc.h"
#include "validation/adbc_validation_util.h"
#define _ADBC_BENCHMARK_RETURN_NOT_OK_IMPL(NAME, EXPR) \
diff --git a/c/driver/postgresql/postgresql_test.cc
b/c/driver/postgresql/postgresql_test.cc
index ab95d3e65..a6d4f7704 100644
--- a/c/driver/postgresql/postgresql_test.cc
+++ b/c/driver/postgresql/postgresql_test.cc
@@ -24,7 +24,7 @@
#include <optional>
#include <variant>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gtest/gtest-param-test.h>
#include <gtest/gtest.h>
#include <nanoarrow/nanoarrow.h>
diff --git a/c/driver/postgresql/result_helper.h
b/c/driver/postgresql/result_helper.h
index 8eec8dc34..25a79fad8 100644
--- a/c/driver/postgresql/result_helper.h
+++ b/c/driver/postgresql/result_helper.h
@@ -23,7 +23,7 @@
#include <utility>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
namespace adbcpq {
diff --git a/c/driver/postgresql/statement.cc b/c/driver/postgresql/statement.cc
index fee28a044..444355123 100644
--- a/c/driver/postgresql/statement.cc
+++ b/c/driver/postgresql/statement.cc
@@ -32,7 +32,7 @@
#include <utility>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
#include <nanoarrow/nanoarrow.hpp>
diff --git a/c/driver/postgresql/statement.h b/c/driver/postgresql/statement.h
index 33be8f0c3..f2387a3ac 100644
--- a/c/driver/postgresql/statement.h
+++ b/c/driver/postgresql/statement.h
@@ -22,7 +22,7 @@
#include <string>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <libpq-fe.h>
#include <nanoarrow/nanoarrow.h>
diff --git a/c/driver/snowflake/CMakeLists.txt
b/c/driver/snowflake/CMakeLists.txt
index 3f05dfa04..1d3874b41 100644
--- a/c/driver/snowflake/CMakeLists.txt
+++ b/c/driver/snowflake/CMakeLists.txt
@@ -35,7 +35,8 @@ add_go_lib("${REPOSITORY_ROOT}/go/adbc/pkg/snowflake/"
foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_include_directories(${LIB_TARGET} SYSTEM
- INTERFACE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
+ INTERFACE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
endforeach()
@@ -61,8 +62,8 @@ if(ADBC_BUILD_TESTS)
${TEST_LINK_LIBS})
target_compile_features(adbc-driver-snowflake-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-snowflake-test SYSTEM
- PRIVATE ${REPOSITORY_ROOT}
- ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver
${REPOSITORY_ROOT}/c/driver/common)
diff --git a/c/driver/snowflake/meson.build b/c/driver/snowflake/meson.build
index d7ad565ec..20a7d3c70 100644
--- a/c/driver/snowflake/meson.build
+++ b/c/driver/snowflake/meson.build
@@ -59,7 +59,7 @@ if get_option('tests')
exc = executable(
'adbc-driver-snowflake-test',
'snowflake_test.cc',
- include_directories: [root_dir, driver_dir],
+ include_directories: [include_dir, c_dir, driver_dir],
link_with: [
adbc_common_lib,
adbc_driver_snowflake_lib,
diff --git a/c/driver/snowflake/snowflake_test.cc
b/c/driver/snowflake/snowflake_test.cc
index a4d742491..60003353d 100644
--- a/c/driver/snowflake/snowflake_test.cc
+++ b/c/driver/snowflake/snowflake_test.cc
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
diff --git a/c/driver/sqlite/CMakeLists.txt b/c/driver/sqlite/CMakeLists.txt
index 3cfdd32bb..d0c45b743 100644
--- a/c/driver/sqlite/CMakeLists.txt
+++ b/c/driver/sqlite/CMakeLists.txt
@@ -64,8 +64,8 @@ foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ADBC_EXPORTING
${ADBC_SQLITE_COMPILE_DEFINES})
target_include_directories(${LIB_TARGET} SYSTEM
- PRIVATE ${REPOSITORY_ROOT}
- ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${SQLite3_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
@@ -98,8 +98,8 @@ if(ADBC_BUILD_TESTS)
PRIVATE ${ADBC_SQLITE_COMPILE_DEFINES})
target_compile_features(adbc-driver-sqlite-test PRIVATE cxx_std_17)
target_include_directories(adbc-driver-sqlite-test SYSTEM
- PRIVATE ${REPOSITORY_ROOT}
- ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
+ ${REPOSITORY_ROOT}/c/include/
${LIBPQ_INCLUDE_DIRS}
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
diff --git a/c/driver/sqlite/meson.build b/c/driver/sqlite/meson.build
index 62c3900df..ad61f7e43 100644
--- a/c/driver/sqlite/meson.build
+++ b/c/driver/sqlite/meson.build
@@ -28,7 +28,7 @@ adbc_sqlite3_driver_lib = library(
'sqlite.cc',
'statement_reader.c',
],
- include_directories: [root_dir],
+ include_directories: [include_dir, c_dir],
link_with: [adbc_common_lib, adbc_framework_lib],
dependencies: [nanoarrow_dep, fmt_dep, sqlite3_dep],
c_args: ['-DSIZEOF_TIME_T=' + time_t_size.to_string()],
@@ -46,7 +46,7 @@ if get_option('tests')
exc = executable(
'adbc-driver-sqlite-test',
sources: ['sqlite_test.cc'],
- include_directories: [root_dir, driver_dir],
+ include_directories: [include_dir, c_dir, driver_dir],
link_with: [
adbc_common_lib,
adbc_sqlite3_driver_lib,
diff --git a/c/driver/sqlite/sqlite.cc b/c/driver/sqlite/sqlite.cc
index f7ed45ae3..c288ba625 100644
--- a/c/driver/sqlite/sqlite.cc
+++ b/c/driver/sqlite/sqlite.cc
@@ -18,7 +18,7 @@
#include <cstdarg>
#include <limits>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <nanoarrow/nanoarrow.h>
#include <sqlite3.h>
#include <nanoarrow/nanoarrow.hpp>
diff --git a/c/driver/sqlite/sqlite_test.cc b/c/driver/sqlite/sqlite_test.cc
index bfb432b15..320eec0e9 100644
--- a/c/driver/sqlite/sqlite_test.cc
+++ b/c/driver/sqlite/sqlite_test.cc
@@ -21,7 +21,7 @@
#include <string>
#include <string_view>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock-matchers.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest-param-test.h>
diff --git a/c/driver/sqlite/statement_reader.c
b/c/driver/sqlite/statement_reader.c
index 8e8fa72c5..a832e7bfd 100644
--- a/c/driver/sqlite/statement_reader.c
+++ b/c/driver/sqlite/statement_reader.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <time.h>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <nanoarrow/nanoarrow.h>
#include <sqlite3.h>
diff --git a/c/driver/sqlite/statement_reader.h
b/c/driver/sqlite/statement_reader.h
index 63a222f05..77333a990 100644
--- a/c/driver/sqlite/statement_reader.h
+++ b/c/driver/sqlite/statement_reader.h
@@ -19,7 +19,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <nanoarrow/nanoarrow.h>
#include <sqlite3.h>
diff --git a/c/driver_manager/CMakeLists.txt b/c/driver_manager/CMakeLists.txt
index 6fb51d9a6..f08b41ecc 100644
--- a/c/driver_manager/CMakeLists.txt
+++ b/c/driver_manager/CMakeLists.txt
@@ -30,8 +30,8 @@ add_arrow_lib(adbc_driver_manager
${CMAKE_DL_LIBS}
SHARED_LINK_FLAGS
${ADBC_LINK_FLAGS})
-include_directories(SYSTEM ${REPOSITORY_ROOT})
include_directories(SYSTEM ${REPOSITORY_ROOT}/c/)
+include_directories(SYSTEM ${REPOSITORY_ROOT}/c/include/)
include_directories(SYSTEM ${REPOSITORY_ROOT}/c/vendor)
include_directories(SYSTEM ${REPOSITORY_ROOT}/c/driver)
@@ -39,8 +39,6 @@ foreach(LIB_TARGET ${ADBC_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ADBC_EXPORTING)
endforeach()
-install(FILES "${REPOSITORY_ROOT}/adbc.h" adbc_driver_manager.h DESTINATION
include)
-
if(ADBC_BUILD_TESTS)
if(ADBC_TEST_LINKAGE STREQUAL "shared")
set(TEST_LINK_LIBS adbc_driver_manager_shared)
diff --git a/c/driver_manager/adbc_driver_manager.cc
b/c/driver_manager/adbc_driver_manager.cc
index d8340c544..44c3d9f98 100644
--- a/c/driver_manager/adbc_driver_manager.cc
+++ b/c/driver_manager/adbc_driver_manager.cc
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-#include "adbc_driver_manager.h"
-#include <adbc.h>
+#include "arrow-adbc/adbc_driver_manager.h"
+#include "arrow-adbc/adbc.h"
#include <algorithm>
#include <array>
diff --git a/c/driver_manager/adbc_driver_manager_test.cc
b/c/driver_manager/adbc_driver_manager_test.cc
index 0eaf644b9..0d8e36250 100644
--- a/c/driver_manager/adbc_driver_manager_test.cc
+++ b/c/driver_manager/adbc_driver_manager_test.cc
@@ -22,8 +22,8 @@
#include <string>
#include <vector>
-#include "adbc.h"
-#include "adbc_driver_manager.h"
+#include "arrow-adbc/adbc.h"
+#include "arrow-adbc/adbc_driver_manager.h"
#include "validation/adbc_validation.h"
#include "validation/adbc_validation_util.h"
diff --git a/c/driver_manager/adbc_version_100.h
b/c/driver_manager/adbc_version_100.h
index b349f86f7..95a045db1 100644
--- a/c/driver_manager/adbc_version_100.h
+++ b/c/driver_manager/adbc_version_100.h
@@ -17,7 +17,7 @@
// A dummy version 1.0.0 ADBC driver to test compatibility.
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#ifdef __cplusplus
extern "C" {
diff --git a/c/driver_manager/adbc_version_100_compatibility_test.cc
b/c/driver_manager/adbc_version_100_compatibility_test.cc
index 27e5f5d99..43079ecb3 100644
--- a/c/driver_manager/adbc_version_100_compatibility_test.cc
+++ b/c/driver_manager/adbc_version_100_compatibility_test.cc
@@ -20,9 +20,9 @@
#include <memory>
-#include "adbc.h"
-#include "adbc_driver_manager.h"
#include "adbc_version_100.h"
+#include "arrow-adbc/adbc.h"
+#include "arrow-adbc/adbc_driver_manager.h"
#include "validation/adbc_validation_util.h"
namespace adbc {
diff --git a/c/driver_manager/meson.build b/c/driver_manager/meson.build
index e7fc4113d..6be37f96f 100644
--- a/c/driver_manager/meson.build
+++ b/c/driver_manager/meson.build
@@ -19,7 +19,7 @@
adbc_driver_manager_lib = library(
'adbc_driver_manager',
'adbc_driver_manager.cc',
- include_directories: [root_dir],
+ include_directories: [include_dir],
install: true,
)
diff --git a/c/driver/postgresql/error.h b/c/include/adbc.h
similarity index 52%
copy from c/driver/postgresql/error.h
copy to c/include/adbc.h
index 75c52b46c..e21d1dc83 100644
--- a/c/driver/postgresql/error.h
+++ b/c/include/adbc.h
@@ -15,28 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-// Error handling utilities.
+#pragma message( \
+ "Including \"adbc.h\" is deprecated. " \
+ "Please include \"arrow-adbc/adbc.h\" instead")
-#pragma once
-
-#include <adbc.h>
-#include <libpq-fe.h>
-
-namespace adbcpq {
-
-// The printf checking attribute doesn't work properly on gcc 4.8
-// and results in spurious compiler warnings
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)
-#define ADBC_CHECK_PRINTF_ATTRIBUTE(x, y) __attribute__((format(printf, x, y)))
-#else
-#define ADBC_CHECK_PRINTF_ATTRIBUTE(x, y)
-#endif
-
-/// \brief Set an error based on a PGresult, inferring the proper ADBC status
-/// code from the PGresult.
-AdbcStatusCode SetError(struct AdbcError* error, PGresult* result, const char*
format,
- ...) ADBC_CHECK_PRINTF_ATTRIBUTE(3, 4);
-
-#undef ADBC_CHECK_PRINTF_ATTRIBUTE
-
-} // namespace adbcpq
+#include "arrow-adbc/adbc.h"
diff --git a/c/driver/postgresql/error.h b/c/include/adbc_driver_manager.h
similarity index 52%
copy from c/driver/postgresql/error.h
copy to c/include/adbc_driver_manager.h
index 75c52b46c..88f8d4d58 100644
--- a/c/driver/postgresql/error.h
+++ b/c/include/adbc_driver_manager.h
@@ -15,28 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-// Error handling utilities.
+#pragma message( \
+ "Including \"adbc_driver_manager.h\" is deprecated. " \
+ "Please include \"arrow-adbc/adbc_driver_manager.h\" instead")
-#pragma once
-
-#include <adbc.h>
-#include <libpq-fe.h>
-
-namespace adbcpq {
-
-// The printf checking attribute doesn't work properly on gcc 4.8
-// and results in spurious compiler warnings
-#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)
-#define ADBC_CHECK_PRINTF_ATTRIBUTE(x, y) __attribute__((format(printf, x, y)))
-#else
-#define ADBC_CHECK_PRINTF_ATTRIBUTE(x, y)
-#endif
-
-/// \brief Set an error based on a PGresult, inferring the proper ADBC status
-/// code from the PGresult.
-AdbcStatusCode SetError(struct AdbcError* error, PGresult* result, const char*
format,
- ...) ADBC_CHECK_PRINTF_ATTRIBUTE(3, 4);
-
-#undef ADBC_CHECK_PRINTF_ATTRIBUTE
-
-} // namespace adbcpq
+#include "arrow-adbc/adbc_driver_manager.h"
diff --git a/go/adbc/drivermgr/adbc.h b/c/include/arrow-adbc/adbc.h
similarity index 99%
rename from go/adbc/drivermgr/adbc.h
rename to c/include/arrow-adbc/adbc.h
index fe0fc4f70..d6c2a4af6 100644
--- a/go/adbc/drivermgr/adbc.h
+++ b/c/include/arrow-adbc/adbc.h
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-/// \file adbc.h ADBC: Arrow Database connectivity
+/// \file arrow-adbc/adbc.h ADBC: Arrow Database connectivity
///
/// An Arrow-based interface between applications and database
/// drivers. ADBC aims to provide a vendor-independent API for SQL
diff --git a/go/adbc/drivermgr/adbc_driver_manager.h
b/c/include/arrow-adbc/adbc_driver_manager.h
similarity index 99%
rename from go/adbc/drivermgr/adbc_driver_manager.h
rename to c/include/arrow-adbc/adbc_driver_manager.h
index 69b767a58..c65bff23b 100644
--- a/go/adbc/drivermgr/adbc_driver_manager.h
+++ b/c/include/arrow-adbc/adbc_driver_manager.h
@@ -17,7 +17,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#ifdef __cplusplus
extern "C" {
diff --git a/c/integration/duckdb/CMakeLists.txt
b/c/integration/duckdb/CMakeLists.txt
index 589d9842c..9065450b0 100644
--- a/c/integration/duckdb/CMakeLists.txt
+++ b/c/integration/duckdb/CMakeLists.txt
@@ -68,7 +68,7 @@ if(ADBC_BUILD_TESTS)
add_dependencies(adbc-integration-duckdb-test duckdb)
target_compile_features(adbc-integration-duckdb-test PRIVATE cxx_std_17)
target_include_directories(adbc-integration-duckdb-test SYSTEM
- PRIVATE ${REPOSITORY_ROOT} ${REPOSITORY_ROOT}/c/
+ PRIVATE ${REPOSITORY_ROOT}/c/
${REPOSITORY_ROOT}/c/include/
${REPOSITORY_ROOT}/c/vendor
${REPOSITORY_ROOT}/c/driver)
adbc_configure_target(adbc-integration-duckdb-test)
diff --git a/c/integration/duckdb/duckdb_test.cc
b/c/integration/duckdb/duckdb_test.cc
index 37bb03e56..5a8ecaf7b 100644
--- a/c/integration/duckdb/duckdb_test.cc
+++ b/c/integration/duckdb/duckdb_test.cc
@@ -17,8 +17,8 @@
#include <cstdlib>
-#include <adbc.h>
-#include <driver_manager/adbc_driver_manager.h>
+#include <arrow-adbc/adbc.h>
+#include <arrow-adbc/adbc_driver_manager.h>
#include <duckdb/common/adbc/adbc-init.hpp>
#include "validation/adbc_validation.h"
diff --git a/c/meson.build b/c/meson.build
index a7077c70f..b93922563 100644
--- a/c/meson.build
+++ b/c/meson.build
@@ -32,7 +32,10 @@ project(
add_project_arguments('-Wno-int-conversion', '-Wno-unused-parameter',
language: 'c')
add_project_arguments('-Wno-unused-parameter', '-Wno-reorder', language: 'cpp')
-root_dir = include_directories('..')
+c_dir = include_directories('.')
+include_dir = include_directories('include')
+install_headers('include/adbc.h')
+install_headers('include/arrow-adbc/adbc.h', subdir: 'arrow-adbc')
driver_dir = include_directories('driver')
nanoarrow_dep = dependency('nanoarrow')
fmt_dep = dependency('fmt')
@@ -51,6 +54,8 @@ needs_driver_manager = get_option('driver_manager') \
pkg = import('pkgconfig')
if needs_driver_manager
+ install_headers('include/adbc_driver_manager.h')
+ install_headers('include/arrow-adbc/adbc_driver_manager.h', subdir:
'arrow-adbc')
subdir('driver_manager')
endif
diff --git a/c/validation/CMakeLists.txt b/c/validation/CMakeLists.txt
index eb29e1469..04bc0115a 100644
--- a/c/validation/CMakeLists.txt
+++ b/c/validation/CMakeLists.txt
@@ -19,7 +19,8 @@ add_library(adbc_validation_util STATIC
adbc_validation_util.cc)
adbc_configure_target(adbc_validation_util)
target_compile_features(adbc_validation_util PRIVATE cxx_std_17)
target_include_directories(adbc_validation_util SYSTEM
- PRIVATE "${REPOSITORY_ROOT}"
"${REPOSITORY_ROOT}/c/driver/"
+ PRIVATE "${REPOSITORY_ROOT}/c/include/"
+ "${REPOSITORY_ROOT}/c/driver/"
"${REPOSITORY_ROOT}/c/vendor/")
target_link_libraries(adbc_validation_util PUBLIC adbc_driver_common nanoarrow
GTest::gtest GTest::gmock)
@@ -30,7 +31,8 @@ add_library(adbc_validation OBJECT
adbc_configure_target(adbc_validation)
target_compile_features(adbc_validation PRIVATE cxx_std_17)
target_include_directories(adbc_validation SYSTEM
- PRIVATE "${REPOSITORY_ROOT}"
"${REPOSITORY_ROOT}/c/driver/"
+ PRIVATE "${REPOSITORY_ROOT}/c/include/"
+ "${REPOSITORY_ROOT}/c/driver/"
"${REPOSITORY_ROOT}/c/vendor/")
target_link_libraries(adbc_validation
PUBLIC adbc_driver_common
diff --git a/c/validation/adbc_validation.cc b/c/validation/adbc_validation.cc
index 355bfd508..5cd592679 100644
--- a/c/validation/adbc_validation.cc
+++ b/c/validation/adbc_validation.cc
@@ -29,7 +29,7 @@
#include <variant>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock.h>
#include <gtest/gtest-matchers.h>
#include <gtest/gtest.h>
diff --git a/c/validation/adbc_validation.h b/c/validation/adbc_validation.h
index abe9a7686..7535d2070 100644
--- a/c/validation/adbc_validation.h
+++ b/c/validation/adbc_validation.h
@@ -23,7 +23,7 @@
#include <variant>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gtest/gtest.h>
#include <nanoarrow/nanoarrow.h>
diff --git a/c/validation/adbc_validation_connection.cc
b/c/validation/adbc_validation_connection.cc
index 4532c1855..80e1fbb7b 100644
--- a/c/validation/adbc_validation_connection.cc
+++ b/c/validation/adbc_validation_connection.cc
@@ -19,7 +19,7 @@
#include <cstring>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/c/validation/adbc_validation_database.cc
b/c/validation/adbc_validation_database.cc
index 371226cc4..78a3a1999 100644
--- a/c/validation/adbc_validation_database.cc
+++ b/c/validation/adbc_validation_database.cc
@@ -19,7 +19,7 @@
#include <cstring>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/c/validation/adbc_validation_statement.cc
b/c/validation/adbc_validation_statement.cc
index 8965e95a0..06b379272 100644
--- a/c/validation/adbc_validation_statement.cc
+++ b/c/validation/adbc_validation_statement.cc
@@ -19,7 +19,7 @@
#include <cstring>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <nanoarrow/nanoarrow.h>
diff --git a/c/validation/adbc_validation_util.cc
b/c/validation/adbc_validation_util.cc
index 24310aba3..b319e5495 100644
--- a/c/validation/adbc_validation_util.cc
+++ b/c/validation/adbc_validation_util.cc
@@ -16,7 +16,7 @@
// under the License.
#include "adbc_validation_util.h"
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include "adbc_validation.h"
diff --git a/c/validation/adbc_validation_util.h
b/c/validation/adbc_validation_util.h
index 08401f2b4..0dba6dafb 100644
--- a/c/validation/adbc_validation_util.h
+++ b/c/validation/adbc_validation_util.h
@@ -27,7 +27,7 @@
#include <utility>
#include <vector>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <nanoarrow/nanoarrow.h>
diff --git a/c/validation/meson.build b/c/validation/meson.build
index 7d08563a0..984f4a34f 100644
--- a/c/validation/meson.build
+++ b/c/validation/meson.build
@@ -19,7 +19,7 @@
adbc_validation_util_lib = static_library(
'adbc_validation_util',
'adbc_validation_util.cc',
- include_directories: [root_dir, driver_dir],
+ include_directories: [include_dir, driver_dir],
link_with: [adbc_common_lib, adbc_framework_lib, adbc_driver_manager_lib],
dependencies: [nanoarrow_dep, gtest_main_dep, gmock_dep],
)
@@ -31,7 +31,7 @@ adbc_validation_dep = declare_dependency(
'adbc_validation_database.cc',
'adbc_validation_statement.cc',
],
- include_directories: [root_dir, driver_dir],
+ include_directories: [include_dir, driver_dir],
link_with: [
adbc_validation_util_lib,
adbc_common_lib,
diff --git a/ci/conda/meta.yaml b/ci/conda/meta.yaml
index a6884e385..90b4e2ef4 100644
--- a/ci/conda/meta.yaml
+++ b/ci/conda/meta.yaml
@@ -39,8 +39,8 @@ outputs:
run:
test:
commands:
- - test -f $PREFIX/include/adbc.h
# [unix]
- - test -f $PREFIX/include/adbc_driver_manager.h
# [unix]
+ - test -f $PREFIX/include/arrow-adbc/adbc.h
# [unix]
+ - test -f $PREFIX/include/arrow-adbc/adbc_driver_manager.h
# [unix]
- test -d $PREFIX/lib/cmake/AdbcDriverManager/
# [unix]
- test -f $PREFIX/lib/pkgconfig/adbc-driver-manager.pc
# [unix]
- test ! -f $PREFIX/lib/libadbc_driver_manager.a
# [unix]
@@ -48,8 +48,8 @@ outputs:
- test -f $PREFIX/lib/libadbc_driver_manager.dylib
# [osx]
- if not exist %LIBRARY_BIN%\adbc_driver_manager.dll exit 1
# [win]
- - if not exist %LIBRARY_INC%\adbc.h exit 1
# [win]
- - if not exist %LIBRARY_INC%\adbc_driver_manager.h exit 1
# [win]
+ - if not exist %LIBRARY_INC%\arrow-adbc\adbc.h exit 1
# [win]
+ - if not exist %LIBRARY_INC%\arrow-adbc\adbc_driver_manager.h exit 1
# [win]
- if not exist %LIBRARY_LIB%\adbc_driver_manager.lib exit 1
# [win]
- if not exist %LIBRARY_LIB%\cmake\AdbcDriverManager exit 1
# [win]
- if not exist %LIBRARY_LIB%\pkgconfig\adbc-driver-manager.pc exit 1
# [win]
diff --git a/ci/linux-packages/debian/libadbc-driver-manager-dev.install
b/ci/linux-packages/debian/libadbc-driver-manager-dev.install
index 6cee53d04..ae0e3c4ff 100644
--- a/ci/linux-packages/debian/libadbc-driver-manager-dev.install
+++ b/ci/linux-packages/debian/libadbc-driver-manager-dev.install
@@ -1,5 +1,6 @@
usr/include/adbc.h
usr/include/adbc_driver_manager.h
+usr/include/arrow-adbc/
usr/lib/*/cmake/AdbcDriverManager/
usr/lib/*/libadbc_driver_manager.a
usr/lib/*/libadbc_driver_manager.so
diff --git a/ci/linux-packages/yum/apache-arrow-adbc.spec.in
b/ci/linux-packages/yum/apache-arrow-adbc.spec.in
index 9af14a2bf..be4b61c5f 100644
--- a/ci/linux-packages/yum/apache-arrow-adbc.spec.in
+++ b/ci/linux-packages/yum/apache-arrow-adbc.spec.in
@@ -122,6 +122,7 @@ Libraries and header files for ADBC driver manager.
%license LICENSE.txt NOTICE.txt
%{_includedir}/adbc.h
%{_includedir}/adbc_driver_manager.h
+%{_includedir}/arrow-adbc
%{_libdir}/cmake/AdbcDriverManager/
%{_libdir}/libadbc_driver_manager.a
%{_libdir}/libadbc_driver_manager.so
diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
b/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
index 957766643..3b55387b1 100644
--- a/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
+++ b/csharp/test/Apache.Arrow.Adbc.Tests/AdbcTests.cs
@@ -207,7 +207,7 @@ namespace Apache.Arrow.Adbc.Tests
{
// find the adbc.h file from the repo
- string path = Path.Combine(new string[] { "..", "..", "..", "..",
"..", "adbc.h" });
+ string path = Path.Combine(new string[] { "..", "..", "..", "..",
"..", "c", "include", "arrow-adbc", "adbc.h"});
Assert.True(File.Exists(path));
diff --git a/dev/release/rat_exclude_files.txt
b/dev/release/rat_exclude_files.txt
index 253798643..7ffcfc13e 100644
--- a/dev/release/rat_exclude_files.txt
+++ b/dev/release/rat_exclude_files.txt
@@ -21,7 +21,7 @@ dev/release/rat_exclude_files.txt
docs/source/format/*.drawio
docs/source/format/*.svg
filtered_rat.txt
-go/adbc/drivermgr/adbc.h
+go/adbc/drivermgr/arrow-adbc/adbc.h
go/adbc/drivermgr/adbc_driver_manager.cc
go/adbc/drivermgr/adbc_driver_manager.h
go/adbc/status_string.go
diff --git a/docs/source/cpp/recipe/quickstart.cc
b/docs/source/cpp/recipe/quickstart.cc
index c1e68565e..bbc7b81e0 100644
--- a/docs/source/cpp/recipe/quickstart.cc
+++ b/docs/source/cpp/recipe/quickstart.cc
@@ -62,7 +62,7 @@
#include <cstring>
#include <iostream>
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <nanoarrow.h>
/// Then we'll add some (very basic) error checking helpers.
diff --git a/docs/source/driver/flight_sql.rst
b/docs/source/driver/flight_sql.rst
index 58ada357e..025988349 100644
--- a/docs/source/driver/flight_sql.rst
+++ b/docs/source/driver/flight_sql.rst
@@ -91,7 +91,7 @@ the :cpp:class:`AdbcDatabase`.
.. code-block:: cpp
- #include "adbc.h"
+ #include "arrow-adbc/adbc.h"
// Ignoring error handling
struct AdbcDatabase database;
diff --git a/docs/source/driver/postgresql.rst
b/docs/source/driver/postgresql.rst
index 8ba54a013..2f67183c8 100644
--- a/docs/source/driver/postgresql.rst
+++ b/docs/source/driver/postgresql.rst
@@ -91,7 +91,7 @@ the :cpp:class:`AdbcDatabase`. This should be a `connection
URI
.. code-block:: cpp
- #include "adbc.h"
+ #include "arrow-adbc/adbc.h"
// Ignoring error handling
struct AdbcDatabase database;
diff --git a/docs/source/driver/snowflake.rst b/docs/source/driver/snowflake.rst
index 2b8608a94..cd33b3646 100644
--- a/docs/source/driver/snowflake.rst
+++ b/docs/source/driver/snowflake.rst
@@ -76,7 +76,7 @@ constructing the :cpp::class:`AdbcDatabase`.
.. code-block:: cpp
- #include "adbc.h"
+ #include "arrow-adbc/adbc.h"
// Ignoring error handling
struct AdbcDatabase database;
diff --git a/docs/source/driver/sqlite.rst b/docs/source/driver/sqlite.rst
index 27df9c865..15c13ceb1 100644
--- a/docs/source/driver/sqlite.rst
+++ b/docs/source/driver/sqlite.rst
@@ -85,7 +85,7 @@ shared across all connections.
.. code-block:: cpp
- #include "adbc.h"
+ #include "arrow-adbc/adbc.h"
// Ignoring error handling
struct AdbcDatabase database;
diff --git a/docs/source/format/how_manager.rst
b/docs/source/format/how_manager.rst
index 2c0218252..6cbd44aca 100644
--- a/docs/source/format/how_manager.rst
+++ b/docs/source/format/how_manager.rst
@@ -91,8 +91,8 @@ options.
Again, the simplest case is as follows: if (1) the application links directly
to the driver, and (2) the driver exposes the ADBC functions *under the same
-name* as in adbc.h, then the application can just ``#include <adbc.h>`` and
-call ``AdbcStatementExecuteQuery(...)`` directly. Here, the application and
+name* as in adbc.h, then the application can just ``#include
<arrow-adbc/adbc.h>``
+and call ``AdbcStatementExecuteQuery(...)`` directly. Here, the application
and
driver have a relationship no different than any other C library.
.. figure:: DriverDirectLink.mmd.svg
diff --git a/glib/adbc-glib/connection-raw.h b/glib/adbc-glib/connection-raw.h
index 5d68e41f1..e5dbf4263 100644
--- a/glib/adbc-glib/connection-raw.h
+++ b/glib/adbc-glib/connection-raw.h
@@ -19,7 +19,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <adbc-glib/connection.h>
diff --git a/glib/adbc-glib/database-raw.h b/glib/adbc-glib/database-raw.h
index 4910003a3..14b80a7fb 100644
--- a/glib/adbc-glib/database-raw.h
+++ b/glib/adbc-glib/database-raw.h
@@ -19,7 +19,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <adbc-glib/database.h>
diff --git a/glib/adbc-glib/error-raw.h b/glib/adbc-glib/error-raw.h
index 3f98a7585..536a62ff9 100644
--- a/glib/adbc-glib/error-raw.h
+++ b/glib/adbc-glib/error-raw.h
@@ -19,7 +19,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <adbc-glib/error.h>
diff --git a/glib/adbc-glib/error.c b/glib/adbc-glib/error.c
index 6a71d6383..777d02fc8 100644
--- a/glib/adbc-glib/error.c
+++ b/glib/adbc-glib/error.c
@@ -17,7 +17,7 @@
* under the License.
*/
-#include <adbc_driver_manager.h>
+#include <arrow-adbc/adbc_driver_manager.h>
/* This is needless. This is just for cpplint. */
#include <adbc-glib/error.h>
diff --git a/glib/adbc-glib/statement-raw.h b/glib/adbc-glib/statement-raw.h
index 15117606e..9bd8f1f9f 100644
--- a/glib/adbc-glib/statement-raw.h
+++ b/glib/adbc-glib/statement-raw.h
@@ -19,7 +19,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#include <adbc-glib/statement.h>
diff --git a/glib/meson.build b/glib/meson.build
index 587015806..1faa83702 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -47,7 +47,7 @@ pkgconfig_variables = ['girdir=@0@'.format(gir_dir)]
base_include_directories = [
include_directories('.'),
- include_directories('..'),
+ include_directories('..' / 'c' / 'include'),
]
gi_fatal_warnings = (build_machine.system() != 'windows')
@@ -60,9 +60,6 @@ endif
if adbc_build_dir == ''
adbc_driver_manager = dependency('adbc-driver-manager')
else
- base_include_directories += [
- include_directories('..' / 'c' / 'driver_manager'),
- ]
c_compiler = meson.get_compiler('c')
adbc_driver_manager = c_compiler.find_library('adbc_driver_manager',
dirs: [adbc_build_dir])
diff --git a/go/adbc/drivermgr/adbc_driver_manager.cc
b/go/adbc/drivermgr/adbc_driver_manager.cc
index d8340c544..44c3d9f98 100644
--- a/go/adbc/drivermgr/adbc_driver_manager.cc
+++ b/go/adbc/drivermgr/adbc_driver_manager.cc
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
-#include "adbc_driver_manager.h"
-#include <adbc.h>
+#include "arrow-adbc/adbc_driver_manager.h"
+#include "arrow-adbc/adbc.h"
#include <algorithm>
#include <array>
diff --git a/adbc.h b/go/adbc/drivermgr/arrow-adbc/adbc.h
similarity index 100%
rename from adbc.h
rename to go/adbc/drivermgr/arrow-adbc/adbc.h
diff --git a/c/driver_manager/adbc_driver_manager.h
b/go/adbc/drivermgr/arrow-adbc/adbc_driver_manager.h
similarity index 99%
rename from c/driver_manager/adbc_driver_manager.h
rename to go/adbc/drivermgr/arrow-adbc/adbc_driver_manager.h
index 69b767a58..c65bff23b 100644
--- a/c/driver_manager/adbc_driver_manager.h
+++ b/go/adbc/drivermgr/arrow-adbc/adbc_driver_manager.h
@@ -17,7 +17,7 @@
#pragma once
-#include <adbc.h>
+#include <arrow-adbc/adbc.h>
#ifdef __cplusplus
extern "C" {
diff --git a/go/adbc/drivermgr/wrapper.go b/go/adbc/drivermgr/wrapper.go
index 31614807d..692cc251d 100644
--- a/go/adbc/drivermgr/wrapper.go
+++ b/go/adbc/drivermgr/wrapper.go
@@ -24,7 +24,7 @@ package drivermgr
// #if !defined(ADBC_EXPORTING)
// #define ADBC_EXPORTING
// #endif
-// #include "adbc.h"
+// #include "arrow-adbc/adbc.h"
// #include <stdlib.h>
// #include <string.h>
//
diff --git a/go/adbc/pkg/_tmpl/driver.go.tmpl b/go/adbc/pkg/_tmpl/driver.go.tmpl
index 77513949f..36d2cd529 100644
--- a/go/adbc/pkg/_tmpl/driver.go.tmpl
+++ b/go/adbc/pkg/_tmpl/driver.go.tmpl
@@ -24,7 +24,7 @@ package main
// #cgo CFLAGS: -DADBC_EXPORTING
// #cgo CXXFLAGS: -std=c++11 -DADBC_EXPORTING
-// #include "../../drivermgr/adbc.h"
+// #include "../../drivermgr/arrow-adbc/adbc.h"
// #include "utils.h"
// #include <errno.h>
// #include <stdint.h>
diff --git a/go/adbc/pkg/_tmpl/utils.h.tmpl b/go/adbc/pkg/_tmpl/utils.h.tmpl
index 8918e5537..15d862f46 100644
--- a/go/adbc/pkg/_tmpl/utils.h.tmpl
+++ b/go/adbc/pkg/_tmpl/utils.h.tmpl
@@ -21,7 +21,7 @@
#pragma once
-#include "../../drivermgr/adbc.h"
+#include "../../drivermgr/arrow-adbc/adbc.h"
#include <stdlib.h>
struct AdbcError* {{.Prefix}}ErrorFromArrayStream(struct ArrowArrayStream*,
AdbcStatusCode*);
diff --git a/go/adbc/pkg/bigquery/driver.go b/go/adbc/pkg/bigquery/driver.go
index 63a1f464a..b6dfbbb38 100644
--- a/go/adbc/pkg/bigquery/driver.go
+++ b/go/adbc/pkg/bigquery/driver.go
@@ -26,7 +26,7 @@ package main
// #cgo CFLAGS: -DADBC_EXPORTING
// #cgo CXXFLAGS: -std=c++11 -DADBC_EXPORTING
-// #include "../../drivermgr/adbc.h"
+// #include "../../drivermgr/arrow-adbc/adbc.h"
// #include "utils.h"
// #include <errno.h>
// #include <stdint.h>
diff --git a/go/adbc/pkg/bigquery/utils.h b/go/adbc/pkg/bigquery/utils.h
index 4667735f2..6e2b96d86 100644
--- a/go/adbc/pkg/bigquery/utils.h
+++ b/go/adbc/pkg/bigquery/utils.h
@@ -24,7 +24,7 @@
#pragma once
#include <stdlib.h>
-#include "../../drivermgr/adbc.h"
+#include "../../drivermgr/arrow-adbc/adbc.h"
struct AdbcError* BigQueryErrorFromArrayStream(struct ArrowArrayStream*,
AdbcStatusCode*);
AdbcStatusCode BigQueryDatabaseGetOption(struct AdbcDatabase*, const char*,
char*,
diff --git a/go/adbc/pkg/flightsql/driver.go b/go/adbc/pkg/flightsql/driver.go
index 2ef68c8ac..2065babdf 100644
--- a/go/adbc/pkg/flightsql/driver.go
+++ b/go/adbc/pkg/flightsql/driver.go
@@ -26,7 +26,7 @@ package main
// #cgo CFLAGS: -DADBC_EXPORTING
// #cgo CXXFLAGS: -std=c++11 -DADBC_EXPORTING
-// #include "../../drivermgr/adbc.h"
+// #include "../../drivermgr/arrow-adbc/adbc.h"
// #include "utils.h"
// #include <errno.h>
// #include <stdint.h>
diff --git a/go/adbc/pkg/flightsql/utils.h b/go/adbc/pkg/flightsql/utils.h
index 4f32609d4..8c26c8439 100644
--- a/go/adbc/pkg/flightsql/utils.h
+++ b/go/adbc/pkg/flightsql/utils.h
@@ -24,7 +24,7 @@
#pragma once
#include <stdlib.h>
-#include "../../drivermgr/adbc.h"
+#include "../../drivermgr/arrow-adbc/adbc.h"
struct AdbcError* FlightSQLErrorFromArrayStream(struct ArrowArrayStream*,
AdbcStatusCode*);
diff --git a/go/adbc/pkg/panicdummy/driver.go b/go/adbc/pkg/panicdummy/driver.go
index b104b0902..05556a06b 100644
--- a/go/adbc/pkg/panicdummy/driver.go
+++ b/go/adbc/pkg/panicdummy/driver.go
@@ -26,7 +26,7 @@ package main
// #cgo CFLAGS: -DADBC_EXPORTING
// #cgo CXXFLAGS: -std=c++11 -DADBC_EXPORTING
-// #include "../../drivermgr/adbc.h"
+// #include "../../drivermgr/arrow-adbc/adbc.h"
// #include "utils.h"
// #include <errno.h>
// #include <stdint.h>
diff --git a/go/adbc/pkg/panicdummy/utils.h b/go/adbc/pkg/panicdummy/utils.h
index 8b205ae31..d225e891a 100644
--- a/go/adbc/pkg/panicdummy/utils.h
+++ b/go/adbc/pkg/panicdummy/utils.h
@@ -24,7 +24,7 @@
#pragma once
#include <stdlib.h>
-#include "../../drivermgr/adbc.h"
+#include "../../drivermgr/arrow-adbc/adbc.h"
struct AdbcError* PanicDummyErrorFromArrayStream(struct ArrowArrayStream*,
AdbcStatusCode*);
diff --git a/go/adbc/pkg/snowflake/driver.go b/go/adbc/pkg/snowflake/driver.go
index 812dbac0f..71530be90 100644
--- a/go/adbc/pkg/snowflake/driver.go
+++ b/go/adbc/pkg/snowflake/driver.go
@@ -26,7 +26,7 @@ package main
// #cgo CFLAGS: -DADBC_EXPORTING
// #cgo CXXFLAGS: -std=c++11 -DADBC_EXPORTING
-// #include "../../drivermgr/adbc.h"
+// #include "../../drivermgr/arrow-adbc/adbc.h"
// #include "utils.h"
// #include <errno.h>
// #include <stdint.h>
diff --git a/go/adbc/pkg/snowflake/utils.h b/go/adbc/pkg/snowflake/utils.h
index 056d0e1a2..8268caaba 100644
--- a/go/adbc/pkg/snowflake/utils.h
+++ b/go/adbc/pkg/snowflake/utils.h
@@ -24,7 +24,7 @@
#pragma once
#include <stdlib.h>
-#include "../../drivermgr/adbc.h"
+#include "../../drivermgr/arrow-adbc/adbc.h"
struct AdbcError* SnowflakeErrorFromArrayStream(struct ArrowArrayStream*,
AdbcStatusCode*);
diff --git a/python/adbc_driver_manager/.gitignore
b/python/adbc_driver_manager/.gitignore
index 54191dfd6..2d7bd5d86 100644
--- a/python/adbc_driver_manager/.gitignore
+++ b/python/adbc_driver_manager/.gitignore
@@ -20,6 +20,7 @@ adbc_driver_manager/*.cc
adbc_driver_manager/*.cpp
adbc_driver_manager/*.h
adbc_driver_manager/*.hpp
+adbc_driver_manager/arrow-adbc/*.h
build/
dist/
repaired_wheels/
diff --git a/python/adbc_driver_manager/MANIFEST.in
b/python/adbc_driver_manager/MANIFEST.in
index 6ad61e9d1..00b27afc5 100644
--- a/python/adbc_driver_manager/MANIFEST.in
+++ b/python/adbc_driver_manager/MANIFEST.in
@@ -19,9 +19,9 @@
include LICENSE.txt
include NOTICE.txt
-include adbc_driver_manager/adbc.h
+include adbc_driver_manager/arrow-adbc/adbc.h
include adbc_driver_manager/adbc_driver_manager.cc
-include adbc_driver_manager/adbc_driver_manager.h
+include adbc_driver_manager/arrow-adbc/adbc_driver_manager.h
include adbc_driver_manager/backward.hpp
include adbc_driver_manager/_blocking_impl.cc
include adbc_driver_manager/_blocking_impl.h
diff --git a/python/adbc_driver_manager/adbc_driver_manager/_lib.pxd
b/python/adbc_driver_manager/adbc_driver_manager/_lib.pxd
index 2beebb314..d900729aa 100644
--- a/python/adbc_driver_manager/adbc_driver_manager/_lib.pxd
+++ b/python/adbc_driver_manager/adbc_driver_manager/_lib.pxd
@@ -20,7 +20,7 @@
from libc.stdint cimport int32_t, int64_t, uint8_t, uint32_t
-cdef extern from "adbc.h" nogil:
+cdef extern from "arrow-adbc/adbc.h" nogil:
# C ABI
ctypedef void (*CArrowSchemaRelease)(void*)
@@ -289,5 +289,5 @@ cdef const CAdbcError* PyAdbcErrorFromArrayStream(
cdef void check_error(CAdbcStatusCode status, CAdbcError* error) except *
cdef object convert_error(CAdbcStatusCode status, CAdbcError* error)
-cdef extern from "adbc_driver_manager.h":
+cdef extern from "arrow-adbc/adbc_driver_manager.h":
const char* CAdbcStatusCodeMessage"AdbcStatusCodeMessage"(CAdbcStatusCode
code)
diff --git a/python/adbc_driver_manager/setup.py
b/python/adbc_driver_manager/setup.py
index e37081780..793ebda15 100644
--- a/python/adbc_driver_manager/setup.py
+++ b/python/adbc_driver_manager/setup.py
@@ -20,6 +20,7 @@
import os
import shutil
import sys
+from collections import namedtuple
from pathlib import Path
from setuptools import Extension, setup
@@ -30,20 +31,25 @@ repo_root = source_root.joinpath("../../")
# ------------------------------------------------------------
# Resolve C++ Sources
-sources = [
- "adbc.h",
- "c/driver_manager/adbc_driver_manager.cc",
- "c/driver_manager/adbc_driver_manager.h",
- "c/vendor/backward/backward.hpp",
+FileToCopy = namedtuple("FileToCopy", ["source", "dest_dir"])
+files_to_copy = [
+ FileToCopy("c/include/arrow-adbc/adbc.h", "arrow-adbc"),
+ FileToCopy("c/driver_manager/adbc_driver_manager.cc", ""),
+ FileToCopy("c/include/arrow-adbc/adbc_driver_manager.h", "arrow-adbc"),
+ FileToCopy("c/vendor/backward/backward.hpp", ""),
]
-for source in sources:
- target_filename = source.split("/")[-1]
- source = repo_root.joinpath(source).resolve()
- target = source_root.joinpath("adbc_driver_manager",
target_filename).resolve()
+for file_to_copy in files_to_copy:
+ target_filename = file_to_copy.source.split("/")[-1]
+ source = repo_root.joinpath(file_to_copy.source).resolve()
+ target_dir = source_root.joinpath(
+ "adbc_driver_manager", file_to_copy.dest_dir
+ ).resolve()
+ target = target_dir.joinpath(target_filename).resolve()
if source.is_file():
# In-tree build/creating an sdist: copy from project root to local file
# so that setuptools isn't confused
+ target_dir.mkdir(parents=True, exist_ok=True)
shutil.copy(source, target)
elif not target.is_file():
# Out-of-tree build missing the C++ source files
diff --git a/r/adbcdrivermanager/bootstrap.R b/r/adbcdrivermanager/bootstrap.R
index 554129bfc..6eb725adf 100644
--- a/r/adbcdrivermanager/bootstrap.R
+++ b/r/adbcdrivermanager/bootstrap.R
@@ -19,9 +19,34 @@
# implementation from the repo. We also run this from configure, so do nothing
# if we aren't sitting within the repo (e.g., installing a source package from
a
# tarball).
+dir.create("src/arrow-adbc", showWarnings=FALSE)
+headers_to_vendor <- c(
+ "../../c/include/arrow-adbc/adbc.h",
+ "../../c/include/arrow-adbc/adbc_driver_manager.h"
+)
+if (all(file.exists(headers_to_vendor))) {
+ files_dst <- file.path("src/arrow-adbc", basename(headers_to_vendor))
+
+ n_removed <- sum(file.remove(files_dst))
+ if (n_removed > 0) {
+ cat(sprintf("Removed %d previously vendored files from src/arrow-adbc/\n",
n_removed))
+ }
+
+ cat(
+ sprintf(
+ "Vendoring headers to src/arrow-adbc/:\n%s\n",
+ paste("-", headers_to_vendor, collapse = "\n")
+ )
+ )
+
+ if (all(file.copy(headers_to_vendor, "src/arrow-adbc"))) {
+ cat("All files successfully copied to src/arrow-adbc/\n")
+ } else {
+ stop("Failed to vendor all headers")
+ }
+}
+
files_to_vendor <- c(
- "../../adbc.h",
- "../../c/driver_manager/adbc_driver_manager.h",
"../../c/driver_manager/adbc_driver_manager.cc",
"../../c/driver/common/driver_base.h"
)
diff --git a/r/adbcdrivermanager/configure b/r/adbcdrivermanager/configure
index 1a59d6e54..0bfdfcd42 100755
--- a/r/adbcdrivermanager/configure
+++ b/r/adbcdrivermanager/configure
@@ -25,28 +25,11 @@ if [ -f bootstrap.R ]; then
$R_HOME/bin/Rscript bootstrap.R --vanilla
fi
-if [ -f "src/adbc.h" ] && [ -f "src/adbc_driver_manager.h" ] && [ -f
"src/adbc_driver_manager.cc" ]; then
+if [ -f "src/arrow-adbc/adbc.h" ] && [ -f
"src/arrow-adbc/adbc_driver_manager.h" ] && [ -f "src/adbc_driver_manager.cc"
]; then
echo "Found vendored ADBC"
exit 0
fi
-# We have a situation where the package has been built via R CMD build
-# manually or with pkgbuild <=1.4.0. This is common (e.g., pak::pkg_install()
-# or remotes::install_github() or any dependency setups that use either method)
-curl -L https://github.com/apache/arrow-adbc/raw/main/adbc.h \
- --output src/adbc.h --silent
-curl -L
https://github.com/apache/arrow-adbc/raw/main/c/driver_manager/adbc_driver_manager.h
\
- --output src/adbc_driver_manager.h --silent
-curl -L
https://github.com/apache/arrow-adbc/raw/main/c/driver_manager/adbc_driver_manager.cc
\
- --output src/adbc_driver_manager.cc --silent
-curl -L
https://github.com/apache/arrow-adbc/raw/main/c/driver/common/driver_base.h \
- --output src/driver_base.h --silent
-
-if [ -f "src/adbc.h" ] && [ -f "src/adbc_driver_manager.h" ] && [ -f
"src/adbc_driver_manager.cc" ]; then
- echo "Fetched ADBC from https://github.com/apache/arrow-adbc"
- exit 0
-fi
-
-echo "Vendored src/adbc.h and/or src/adbc_driver_manager.cc are missing"
+echo "Vendored src/arrow-adbc/adbc.h and/or src/adbc_driver_manager.cc are
missing"
echo "This source package was probably built incorrectly and it's probably not
your fault"
exit 1
diff --git a/r/adbcdrivermanager/src/driver_test.cc
b/r/adbcdrivermanager/src/driver_test.cc
index 030449801..5172f004b 100644
--- a/r/adbcdrivermanager/src/driver_test.cc
+++ b/r/adbcdrivermanager/src/driver_test.cc
@@ -23,7 +23,7 @@
#include "driver_base.h"
-#include <adbc.h>
+#include "arrow-adbc/adbc.h"
using adbc::common::ConnectionObjectBase;
using adbc::common::DatabaseObjectBase;
diff --git a/r/adbcdrivermanager/src/error.cc b/r/adbcdrivermanager/src/error.cc
index 0ff01b879..ffb643e91 100644
--- a/r/adbcdrivermanager/src/error.cc
+++ b/r/adbcdrivermanager/src/error.cc
@@ -21,8 +21,8 @@
#include <cstring>
-#include <adbc.h>
-#include "adbc_driver_manager.h"
+#include "arrow-adbc/adbc.h"
+#include "arrow-adbc/adbc_driver_manager.h"
#include "radbc.h"
static void finalize_error_xptr(SEXP error_xptr) {
diff --git a/r/adbcdrivermanager/src/options.cc
b/r/adbcdrivermanager/src/options.cc
index 3909124c5..fa73a062b 100644
--- a/r/adbcdrivermanager/src/options.cc
+++ b/r/adbcdrivermanager/src/options.cc
@@ -19,7 +19,7 @@
#include <R.h>
#include <Rinternals.h>
-#include <adbc.h>
+#include "arrow-adbc/adbc.h"
#include "radbc.h"
diff --git a/r/adbcdrivermanager/src/radbc.cc b/r/adbcdrivermanager/src/radbc.cc
index 021b1e861..1a39765d4 100644
--- a/r/adbcdrivermanager/src/radbc.cc
+++ b/r/adbcdrivermanager/src/radbc.cc
@@ -22,8 +22,8 @@
#include <cstring>
#include <utility>
-#include <adbc.h>
-#include "adbc_driver_manager.h"
+#include "arrow-adbc/adbc.h"
+#include "arrow-adbc/adbc_driver_manager.h"
#include "radbc.h"
diff --git a/r/adbcdrivermanager/src/radbc.h b/r/adbcdrivermanager/src/radbc.h
index 4f1ec2831..cff1b9edd 100644
--- a/r/adbcdrivermanager/src/radbc.h
+++ b/r/adbcdrivermanager/src/radbc.h
@@ -22,7 +22,7 @@
#include <utility>
-#include <adbc.h>
+#include "arrow-adbc/adbc.h"
template <typename T>
static inline const char* adbc_xptr_class();
diff --git a/r/adbcflightsql/bootstrap.R b/r/adbcflightsql/bootstrap.R
index 3e57feb3b..b29da14b0 100644
--- a/r/adbcflightsql/bootstrap.R
+++ b/r/adbcflightsql/bootstrap.R
@@ -31,8 +31,8 @@ files_to_vendor_dst <- file.path("src/go/adbc",
files_to_vendor)
# is not a problem for a user install, where this script
# should not even exist, but the below helps development
# on Windows.
-is_adbc_h <- basename(files_to_vendor_src) == "adbc.h"
-files_to_vendor_src[is_adbc_h] <- "../../adbc.h"
+dir.create("src/arrow-adbc", showWarnings=FALSE)
+file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")
if (all(file.exists(files_to_vendor_src))) {
unlink("src/go/adbc", recursive = TRUE)
diff --git a/r/adbcpostgresql/bootstrap.R b/r/adbcpostgresql/bootstrap.R
index 32e13601d..0357a3be6 100644
--- a/r/adbcpostgresql/bootstrap.R
+++ b/r/adbcpostgresql/bootstrap.R
@@ -15,75 +15,21 @@
# specific language governing permissions and limitations
# under the License.
-# If we are building within the repo, copy the latest adbc.h and driver source
-# into src/
-source_files <- c(
- "adbc.h",
- "c/driver/common/options.h",
- "c/driver/common/utils.c",
- "c/driver/common/utils.h",
- "c/driver/framework/catalog.h",
- "c/driver/framework/catalog.cc",
- "c/driver/framework/status.h",
- "c/driver/postgresql/connection.cc",
- "c/driver/postgresql/connection.h",
- "c/driver/postgresql/copy/copy_common.h",
- "c/driver/postgresql/copy/reader.h",
- "c/driver/postgresql/copy/writer.h",
- "c/driver/postgresql/database.cc",
- "c/driver/postgresql/database.h",
- "c/driver/postgresql/error.cc",
- "c/driver/postgresql/error.h",
- "c/driver/postgresql/postgres_type.h",
- "c/driver/postgresql/postgres_util.h",
- "c/driver/postgresql/postgresql.cc",
- "c/driver/postgresql/result_helper.cc",
- "c/driver/postgresql/result_helper.h",
- "c/driver/postgresql/statement.cc",
- "c/driver/postgresql/statement.h",
- "c/vendor/fmt/include/fmt/args.h",
- "c/vendor/fmt/include/fmt/base.h",
- "c/vendor/fmt/include/fmt/chrono.h",
- "c/vendor/fmt/include/fmt/color.h",
- "c/vendor/fmt/include/fmt/compile.h",
- "c/vendor/fmt/include/fmt/core.h",
- "c/vendor/fmt/include/fmt/format-inl.h",
- "c/vendor/fmt/include/fmt/format.h",
- "c/vendor/fmt/include/fmt/os.h",
- "c/vendor/fmt/include/fmt/ostream.h",
- "c/vendor/fmt/include/fmt/printf.h",
- "c/vendor/fmt/include/fmt/ranges.h",
- "c/vendor/fmt/include/fmt/std.h",
- "c/vendor/fmt/include/fmt/xchar.h",
- "c/vendor/nanoarrow/nanoarrow.c",
- "c/vendor/nanoarrow/nanoarrow.h",
- "c/vendor/nanoarrow/nanoarrow.hpp"
-)
-files_to_vendor <- file.path("../..", source_files)
+dir.create("src/arrow-adbc", showWarnings = FALSE)
+file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")
-if (all(file.exists(files_to_vendor))) {
- files_dst <- file.path("src", basename(files_to_vendor))
+source_files <- list.files("../../c", "\\.(h|c|cc|hpp)$", recursive = TRUE)
+source_files <- source_files[!grepl("_test\\.cc", source_files)]
+source_files <- source_files[!grepl("^(build|out)/", source_files)]
+# backward C++ causes CRAN warnings and the drivers do not use it
+source_files <- source_files[!grepl("^vendor/backward", source_files)]
+source_files <- file.path("c", source_files)
+src <- file.path("../..", source_files)
+dst <- file.path("src", source_files)
- n_removed <- suppressWarnings(sum(file.remove(files_dst)))
- if (n_removed > 0) {
- cat(sprintf("Removed %d previously vendored files from src/\n", n_removed))
- }
-
- cat(
- sprintf(
- "Vendoring files from arrow-adbc to src/:\n%s\n",
- paste("-", files_to_vendor, collapse = "\n")
- )
- )
-
- if (!dir.exists("src/copy")) {
- dir.create("src/copy")
- }
-
- if (all(file.copy(files_to_vendor, "src"))) {
- file.rename(files_dst, file.path("src", source_files))
- cat("All files successfully copied to src/\n")
- } else {
- stop("Failed to vendor all files")
- }
+unlink("src/c", recursive = TRUE)
+for (dir_name in rev(unique(dirname(dst)))) {
+ dir.create(dir_name, showWarnings = FALSE, recursive = TRUE)
}
+
+stopifnot(all(file.copy(src, dst)))
diff --git a/r/adbcpostgresql/configure b/r/adbcpostgresql/configure
index a08dfc91d..d23dab0a6 100755
--- a/r/adbcpostgresql/configure
+++ b/r/adbcpostgresql/configure
@@ -77,14 +77,3 @@ sed \
-e "s|@cppflags@|$PKG_CPPFLAGS|" \
-e "s|@libs@|$PKG_LIBS|" \
src/Makevars.in > src/Makevars
-
-
-if [ -f "src/adbc.h" ]; then
- echo "Found vendored ADBC"
- exit 0
-fi
-
-
-echo "Vendored ADBC PostgreSQL driver was not found."
-echo "This source package was probably built incorrectly and it's probably not
your fault"
-exit 1
diff --git a/r/adbcpostgresql/src/.gitignore b/r/adbcpostgresql/src/.gitignore
index 2a843f05a..f3f4404d9 100644
--- a/r/adbcpostgresql/src/.gitignore
+++ b/r/adbcpostgresql/src/.gitignore
@@ -18,5 +18,6 @@
*.o
*.so
*.dll
-adbc.h
Makevars
+arrow-adbc/
+c/
diff --git a/r/adbcpostgresql/src/c/driver/common/.gitignore
b/r/adbcpostgresql/src/c/driver/common/.gitignore
deleted file mode 100644
index c0263b579..000000000
--- a/r/adbcpostgresql/src/c/driver/common/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# License); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-options.h
-utils.c
-utils.h
diff --git a/r/adbcpostgresql/src/c/driver/framework/.gitignore
b/r/adbcpostgresql/src/c/driver/framework/.gitignore
deleted file mode 100644
index 0c9f34547..000000000
--- a/r/adbcpostgresql/src/c/driver/framework/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# License); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-catalog.h
-catalog.cc
-status.h
diff --git a/r/adbcpostgresql/src/c/driver/postgresql/.gitignore
b/r/adbcpostgresql/src/c/driver/postgresql/.gitignore
deleted file mode 100644
index aecdf7e98..000000000
--- a/r/adbcpostgresql/src/c/driver/postgresql/.gitignore
+++ /dev/null
@@ -1,30 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# License); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-connection.cc
-connection.h
-database.cc
-database.h
-error.cc
-error.h
-postgres_type.h
-postgres_util.h
-postgresql.cc
-result_helper.cc
-result_helper.h
-statement.cc
-statement.h
diff --git a/r/adbcpostgresql/src/c/driver/postgresql/copy/.gitignore
b/r/adbcpostgresql/src/c/driver/postgresql/copy/.gitignore
deleted file mode 100644
index f3e987e46..000000000
--- a/r/adbcpostgresql/src/c/driver/postgresql/copy/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# License); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-copy_common.h
-reader.h
-writer.h
diff --git a/r/adbcpostgresql/src/c/vendor/fmt/include/fmt/.gitignore
b/r/adbcpostgresql/src/c/vendor/fmt/include/fmt/.gitignore
deleted file mode 100644
index 7140f743d..000000000
--- a/r/adbcpostgresql/src/c/vendor/fmt/include/fmt/.gitignore
+++ /dev/null
@@ -1,31 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# License); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-args.h
-base.h
-chrono.h
-color.h
-compile.h
-core.h
-format-inl.h
-format.h
-os.h
-ostream.h
-printf.h
-ranges.h
-std.h
-xchar.h
diff --git a/r/adbcpostgresql/src/c/vendor/nanoarrow/.gitignore
b/r/adbcpostgresql/src/c/vendor/nanoarrow/.gitignore
deleted file mode 100644
index 0b33acf34..000000000
--- a/r/adbcpostgresql/src/c/vendor/nanoarrow/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# License); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-nanoarrow.c
-nanoarrow.h
-nanoarrow.hpp
diff --git a/r/adbcpostgresql/src/init.cc b/r/adbcpostgresql/src/init.cc
index 1d1c81d82..b917186df 100644
--- a/r/adbcpostgresql/src/init.cc
+++ b/r/adbcpostgresql/src/init.cc
@@ -19,7 +19,7 @@
#include <R.h>
#include <Rinternals.h>
-#include <adbc.h>
+#include "arrow-adbc/adbc.h"
extern "C" {
AdbcStatusCode AdbcDriverInit(int version, void* raw_driver, struct AdbcError*
error);
diff --git a/r/adbcsnowflake/bootstrap.R b/r/adbcsnowflake/bootstrap.R
index 3e57feb3b..b29da14b0 100644
--- a/r/adbcsnowflake/bootstrap.R
+++ b/r/adbcsnowflake/bootstrap.R
@@ -31,8 +31,8 @@ files_to_vendor_dst <- file.path("src/go/adbc",
files_to_vendor)
# is not a problem for a user install, where this script
# should not even exist, but the below helps development
# on Windows.
-is_adbc_h <- basename(files_to_vendor_src) == "adbc.h"
-files_to_vendor_src[is_adbc_h] <- "../../adbc.h"
+dir.create("src/arrow-adbc", showWarnings=FALSE)
+file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")
if (all(file.exists(files_to_vendor_src))) {
unlink("src/go/adbc", recursive = TRUE)
diff --git a/r/adbcsqlite/bootstrap.R b/r/adbcsqlite/bootstrap.R
index f5d7734a4..0357a3be6 100644
--- a/r/adbcsqlite/bootstrap.R
+++ b/r/adbcsqlite/bootstrap.R
@@ -15,68 +15,21 @@
# specific language governing permissions and limitations
# under the License.
-# If we are building within the repo, copy the latest adbc.h and driver source
-# into src/
-source_files <- c(
- "adbc.h",
- "c/driver/sqlite/sqlite.cc",
- "c/driver/sqlite/statement_reader.c",
- "c/driver/sqlite/statement_reader.h",
- "c/driver/common/options.h",
- "c/driver/common/utils.c",
- "c/driver/common/utils.h",
- "c/driver/framework/base_connection.h",
- "c/driver/framework/base_database.h",
- "c/driver/framework/base_driver.cc",
- "c/driver/framework/base_driver.h",
- "c/driver/framework/base_statement.h",
- "c/driver/framework/catalog.h",
- "c/driver/framework/objects.h",
- "c/driver/framework/status.h",
- "c/driver/framework/type_fwd.h",
- "c/driver/framework/catalog.cc",
- "c/driver/framework/objects.cc",
- "c/vendor/fmt/include/fmt/args.h",
- "c/vendor/fmt/include/fmt/base.h",
- "c/vendor/fmt/include/fmt/chrono.h",
- "c/vendor/fmt/include/fmt/color.h",
- "c/vendor/fmt/include/fmt/compile.h",
- "c/vendor/fmt/include/fmt/core.h",
- "c/vendor/fmt/include/fmt/format-inl.h",
- "c/vendor/fmt/include/fmt/format.h",
- "c/vendor/fmt/include/fmt/os.h",
- "c/vendor/fmt/include/fmt/ostream.h",
- "c/vendor/fmt/include/fmt/printf.h",
- "c/vendor/fmt/include/fmt/ranges.h",
- "c/vendor/fmt/include/fmt/std.h",
- "c/vendor/fmt/include/fmt/xchar.h",
- "c/vendor/nanoarrow/nanoarrow.h",
- "c/vendor/nanoarrow/nanoarrow.hpp",
- "c/vendor/nanoarrow/nanoarrow.c",
- "c/vendor/sqlite3/sqlite3.h",
- "c/vendor/sqlite3/sqlite3.c"
-)
-files_to_vendor <- file.path("../..", source_files)
+dir.create("src/arrow-adbc", showWarnings = FALSE)
+file.copy("../../c/include/arrow-adbc/adbc.h", "src/arrow-adbc/adbc.h")
-if (all(file.exists(files_to_vendor))) {
- files_dst <- file.path("src", basename(files_to_vendor))
+source_files <- list.files("../../c", "\\.(h|c|cc|hpp)$", recursive = TRUE)
+source_files <- source_files[!grepl("_test\\.cc", source_files)]
+source_files <- source_files[!grepl("^(build|out)/", source_files)]
+# backward C++ causes CRAN warnings and the drivers do not use it
+source_files <- source_files[!grepl("^vendor/backward", source_files)]
+source_files <- file.path("c", source_files)
+src <- file.path("../..", source_files)
+dst <- file.path("src", source_files)
- n_removed <- suppressWarnings(sum(file.remove(files_dst)))
- if (n_removed > 0) {
- cat(sprintf("Removed %d previously vendored files from src/\n", n_removed))
- }
-
- cat(
- sprintf(
- "Vendoring files from arrow-adbc to src/:\n%s\n",
- paste("-", files_to_vendor, collapse = "\n")
- )
- )
-
- if (all(file.copy(files_to_vendor, "src"))) {
- file.rename(files_dst, file.path("src", source_files))
- cat("All files successfully copied to src/\n")
- } else {
- stop("Failed to vendor all files")
- }
+unlink("src/c", recursive = TRUE)
+for (dir_name in rev(unique(dirname(dst)))) {
+ dir.create(dir_name, showWarnings = FALSE, recursive = TRUE)
}
+
+stopifnot(all(file.copy(src, dst)))
diff --git a/r/adbcsqlite/configure b/r/adbcsqlite/configure
index a04044a8f..52795bd4c 100755
--- a/r/adbcsqlite/configure
+++ b/r/adbcsqlite/configure
@@ -77,14 +77,3 @@ sed \
-e "s|@libs@|$PKG_LIBS|" \
-e "s|@objects@|$OBJECTS|" \
src/Makevars.in > src/Makevars
-
-
-if [ -f "src/adbc.h" ]; then
- echo "Found vendored ADBC"
- exit 0
-fi
-
-
-echo "Vendored ADBC SQLite driver was not found."
-echo "This source package was probably built incorrectly and it's probably not
your fault"
-exit 1
diff --git a/r/adbcsqlite/src/.gitignore b/r/adbcsqlite/src/.gitignore
index 36b4b3263..32f6b7b87 100644
--- a/r/adbcsqlite/src/.gitignore
+++ b/r/adbcsqlite/src/.gitignore
@@ -18,7 +18,8 @@
*.o
*.so
*.dll
-adbc.h
Makevars
sqlite3.c
sqlite3.h
+c/
+arrow-adbc/
diff --git a/r/adbcsqlite/src/c/driver/common/.gitignore
b/r/adbcsqlite/src/c/driver/common/.gitignore
deleted file mode 100644
index 735f377b8..000000000
--- a/r/adbcsqlite/src/c/driver/common/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-options.h
-utils.c
-utils.h
diff --git a/r/adbcsqlite/src/c/driver/framework/.gitignore
b/r/adbcsqlite/src/c/driver/framework/.gitignore
deleted file mode 100644
index 9e7f94dec..000000000
--- a/r/adbcsqlite/src/c/driver/framework/.gitignore
+++ /dev/null
@@ -1,27 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-base_driver.cc
-base_driver.h
-base_connection.h
-base_database.h
-base_statement.h
-catalog.h
-objects.h
-status.h
-type_fwd.h
-catalog.cc
-objects.cc
diff --git a/r/adbcsqlite/src/c/driver/sqlite/.gitignore
b/r/adbcsqlite/src/c/driver/sqlite/.gitignore
deleted file mode 100644
index 8e5eb9cc3..000000000
--- a/r/adbcsqlite/src/c/driver/sqlite/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-sqlite.cc
-statement_reader.c
-statement_reader.h
diff --git a/r/adbcsqlite/src/c/vendor/fmt/.gitignore
b/r/adbcsqlite/src/c/vendor/fmt/.gitignore
deleted file mode 100644
index b2a0402cd..000000000
--- a/r/adbcsqlite/src/c/vendor/fmt/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-.clang-format
-CMakeLists.txt
-CONTRIBUTING.md
-ChangeLog.md
-LICENSE
-README.md
diff --git a/r/adbcsqlite/src/c/vendor/fmt/include/fmt/.gitignore
b/r/adbcsqlite/src/c/vendor/fmt/include/fmt/.gitignore
deleted file mode 100644
index 871262113..000000000
--- a/r/adbcsqlite/src/c/vendor/fmt/include/fmt/.gitignore
+++ /dev/null
@@ -1,30 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-args.h
-base.h
-chrono.h
-color.h
-compile.h
-core.h
-format-inl.h
-format.h
-os.h
-ostream.h
-printf.h
-ranges.h
-std.h
-xchar.h
diff --git a/r/adbcsqlite/src/c/vendor/fmt/src/.gitignore
b/r/adbcsqlite/src/c/vendor/fmt/src/.gitignore
deleted file mode 100644
index 83c7eba3b..000000000
--- a/r/adbcsqlite/src/c/vendor/fmt/src/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-fmt.cc
-format.cc
-os.cc
diff --git a/r/adbcsqlite/src/c/vendor/fmt/support/cmake/.gitignore
b/r/adbcsqlite/src/c/vendor/fmt/support/cmake/.gitignore
deleted file mode 100644
index f13b4b24e..000000000
--- a/r/adbcsqlite/src/c/vendor/fmt/support/cmake/.gitignore
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-FindSetEnv.cmake
-JoinPaths.cmake
-fmt-config.cmake.in
-fmt.pc.in
diff --git a/r/adbcsqlite/src/c/vendor/nanoarrow/.gitignore
b/r/adbcsqlite/src/c/vendor/nanoarrow/.gitignore
deleted file mode 100644
index 2c49ef736..000000000
--- a/r/adbcsqlite/src/c/vendor/nanoarrow/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-nanoarrow.h
-nanoarrow.hpp
-nanoarrow.c
diff --git a/r/adbcsqlite/src/c/vendor/sqlite3/.gitignore
b/r/adbcsqlite/src/c/vendor/sqlite3/.gitignore
deleted file mode 100644
index 07444722b..000000000
--- a/r/adbcsqlite/src/c/vendor/sqlite3/.gitignore
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-sqlite3.h
-sqlite3.c
diff --git a/r/adbcsqlite/src/init.cc b/r/adbcsqlite/src/init.cc
index 48dc05916..3c921c19c 100644
--- a/r/adbcsqlite/src/init.cc
+++ b/r/adbcsqlite/src/init.cc
@@ -19,7 +19,7 @@
#include <R.h>
#include <Rinternals.h>
-#include <adbc.h>
+#include "arrow-adbc/adbc.h"
extern "C" {
AdbcStatusCode SqliteDriverInit(int version, void* raw_driver, struct
AdbcError* error);