This PR implements a C++ wrapper around the C API to cut down on some of the verbosity of using ADBC from C++ and ensure the assumptions made by drivers (e.g., that parent objects are valid). One of the difficulties of building an ADBC driver is testing it...the validation library helps here but is still rather verbose. I'm hoping this will help make it easier to write great tests for new drivers!
The implementation is probably more verbose than it has to be but has some nice properties:
Doesn't depend on the AdbcXXX() symbols (so it can be used by a driver like DuckDB and/or a future GDAL to federate from ADBC sources while also being an ADBC driver itself)
Doesn't segfault (or it's not supposed to!) if you release a parent structure and subsequently interact with a child (instead you (should) get an error telling you which level of object is no longer valid). This might have performance implications since it basically checks for validity all the way back up to the driver on every call (even down to the stream's get_next()!)
Warns you (or can be configured to warn you) if you don't explicitly release everything exactly once (and tells you what you forgot to not explicitly release instead before leaking or instead of crashing)
Just a preliminary go at #598!
This PR implements a C++ wrapper around the C API to cut down on some of the verbosity of using ADBC from C++ and ensure the assumptions made by drivers (e.g., that parent objects are valid). One of the difficulties of building an ADBC driver is testing it...the validation library helps here but is still rather verbose. I'm hoping this will help make it easier to write great tests for new drivers!
Current syntax:
The implementation is probably more verbose than it has to be but has some nice properties:
AdbcXXX()
symbols (so it can be used by a driver like DuckDB and/or a future GDAL to federate from ADBC sources while also being an ADBC driver itself)get_next()
!)Work in progress!