lidavidm commented on code in PR #3204: URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2232558453
########## go/adbc/README.md: ########## @@ -0,0 +1,251 @@ +# adbc Review Comment: Needs the license header ########## go/adbc/README.md: ########## @@ -0,0 +1,251 @@ +# adbc + +The adbc package provides: + +- Go Interfaces to [Arrow Database Connectivity](https://arrow.apache.org/adbc) (ADBC) for building ADBC drivers +- An ADBC Driver Manager package (`drivermgr`) for loading and using ADBC Drivers +- Scaffolding for writing new drivers in Go (`pkg`) + +See the [ADBC Website](https://arrow.apache.org/adbc/current/index.html) for more information on ADBC. + +## Getting Started + +To use ADBC with your database, you will need: + +1. An ADBC driver for your database +2. The ADBC `drivermgr` package to load and use the driver Review Comment: This is not necessarily true, if the driver is written in Go ########## go/adbc/README.md: ########## @@ -0,0 +1,251 @@ +# adbc + +The adbc package provides: + +- Go Interfaces to [Arrow Database Connectivity](https://arrow.apache.org/adbc) (ADBC) for building ADBC drivers +- An ADBC Driver Manager package (`drivermgr`) for loading and using ADBC Drivers Review Comment: Also I want to dissuade the notion that the only way to use drivers is via the driver manager or FFI. ########## go/adbc/README.md: ########## @@ -0,0 +1,251 @@ +# adbc + +The adbc package provides: + +- Go Interfaces to [Arrow Database Connectivity](https://arrow.apache.org/adbc) (ADBC) for building ADBC drivers +- An ADBC Driver Manager package (`drivermgr`) for loading and using ADBC Drivers +- Scaffolding for writing new drivers in Go (`pkg`) + +See the [ADBC Website](https://arrow.apache.org/adbc/current/index.html) for more information on ADBC. + +## Getting Started + +To use ADBC with your database, you will need: + +1. An ADBC driver for your database +2. The ADBC `drivermgr` package to load and use the driver + +Below we show how to use the `drivermgr` package to load and use the SQLite ADBC Driver. +Not shown is how to make the SQLite ADBC driver available to the `drivermgr`. + +### Installation + +```sh +go get github.com/apache/arrow-adbc/go/adbc/drivermgr +``` + +### Creating a Connection + +```go +import ( + "context" + "github.com/apache/arrow-adbc/go/adbc" + "github.com/apache/arrow-adbc/go/adbc/drivermgr" +) + +ctx := context.Background() + +// Create driver and database +var drv drivermgr.Driver +db, err := drv.NewDatabase(map[string]string{ + "driver": "adbc_driver_sqlite", +}) +if err != nil { + return err +} +defer db.Close() + +// Open connection +conn, err := db.Open(ctx) +if err != nil { + return err +} +defer conn.Close() +``` + +In application code, both the database and connection must be closed after usage or +memory may leak. Use ``defer`` statements to ensure proper cleanup. + +### Creating a Statement + +```go +stmt, err := conn.NewStatement() +if err != nil { + return err +} +defer stmt.Close() Review Comment: FWIW, this will make linters complain because Close is fallible ########## go/adbc/README.md: ########## @@ -0,0 +1,251 @@ +# adbc + +The adbc package provides: + +- Go Interfaces to [Arrow Database Connectivity](https://arrow.apache.org/adbc) (ADBC) for building ADBC drivers +- An ADBC Driver Manager package (`drivermgr`) for loading and using ADBC Drivers +- Scaffolding for writing new drivers in Go (`pkg`) + +See the [ADBC Website](https://arrow.apache.org/adbc/current/index.html) for more information on ADBC. + +## Getting Started + +To use ADBC with your database, you will need: + +1. An ADBC driver for your database +2. The ADBC `drivermgr` package to load and use the driver Review Comment: The common point is the interface definitions; loading the driver can vary ########## go/adbc/README.md: ########## @@ -0,0 +1,251 @@ +# adbc + +The adbc package provides: + +- Go Interfaces to [Arrow Database Connectivity](https://arrow.apache.org/adbc) (ADBC) for building ADBC drivers +- An ADBC Driver Manager package (`drivermgr`) for loading and using ADBC Drivers Review Comment: Hmm, the interfaces are for both using and building drivers. Maybe it's better to say something along the lines of, "Go interface definitions for using Arrow data and databases, called ADBC" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org