feat(c/driver/common): Add minimal C++ driver framework #1539
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This bit of code has been in the R bindings for a few months...I use it to make a few throwaway test drivers that make it easier to write self-contained tests in the adbcdrivermanager package. I'm wondering if moving it into
c/common
could help us move towards a common code base for the Postgres and SQLite drivers and lower the barrier for others to contribute drivers (or just copydriver_base.h
and write/maintain it themselves somewhere else).ADBC drivers are beautifully simple things: if you can turn an
std::string
into anArrowArrayStream
, you have an ADBC driver. Unfortunately, there are a lot of boring details that are easy to get wrong between a would-be driver contributor and a fully functional ADBC driver. I see the "boring details that are easy to get wrong" are (1) remembering how to initialize the C callables in a drive, (2) options set/get (particularly with ADBC 1.1), and (3) error handling.The draft I've included here lets you implement the minimal driver I described above as:
I'm happy to redo anything about this (including refactor the Postgres/SQLite drivers to use it) but wanted to pause before going further to make sure we actually want to do this!