Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(go/adbc/driver): driverbase implementation for connection (#…
…1590) Implementation of Connection driver base, along with a refactor of Driver and Database bases. The bases have been refactored in the following way: - The `*Impl` interface (e.g. `DatabaseImpl`) now explicitly implements the corresponding `adbc` interface (e.g. `adbc.Database`). - We now check to guarantee the `DatabaseImplBase` implements the entire `DatabaseImpl` interface with stub methods or default implementations. - A new interface has been added (e.g. `driverbase.Database`) which contains all methods the _output_ of driverbase constructor `NewDatabase()` should be. This helps document and guarantee the "extra" behavior provided by using the driverbase. This interface should be internal to the library. - By embedding `DatabaseImpl` in the `database` struct (and similarly for the other bases) it automatically inherits implementations coming from the `DatabaseImpl`. This way we don't need to write out all the implementations a second time, hence the deletes. - The Connection base uses a builder for its constructor to register any helper methods (see discussion in comments). The Driver and Database bases use simple function constructors because they don't have any helpers to register. This felt simpler but I can make those into trivial builders as well if we prefer to have consistency between them. A new `DriverInfo` type has been introduced to help consolidate the collection and validation of metadata for `GetInfo()`. There are more small changes such as refactors of the flightsql and snowflake drivers to make use of the added functionality, as well as a new set of tests for the driverbase. Please let me know if anything else could use clarification. Resolves #1105.
- Loading branch information