You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "amoeba (via GitHub)" <gi...@apache.org> on 2025/07/25 19:19:06 UTC

[PR] docs: improve go docs by adding a readme [arrow-adbc]

amoeba opened a new pull request, #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204

   Improves the existing go pkgsite by adding a README.
   
   This is an alternative to https://github.com/apache/arrow-adbc/pull/3199.


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#issuecomment-3120061806

   I deployed a preview to https://6883d84fdd2114b798da2f70--adbc-docs.netlify.app if anyone wants to take a look. I think this is pretty promising as a way of achieving https://github.com/apache/arrow-adbc/issues/3198 without abandoning the built-in Go pkgsite documentation tool.


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#issuecomment-3156356083

   Merged, thanks for the reviews.


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba merged PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2240801106


##########
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()
+```
+
+In application code, the statement must be closed after usage or memory
+may leak. Use ``defer`` statements to ensure proper cleanup.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+if err != nil {
+    return err
+}
+
+reader, _, err := stmt.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader.Release()
+
+for reader.Next() {
+    record := reader.Record()
+    // Access columns by index
+    col0 := record.Column(0) // int64 array
+    col1 := record.Column(1) // float64 array
+    col2 := record.Column(2) // string array
+
+    // Process the data...
+    for i := 0; i < int(record.NumRows()); i++ {
+        // Access individual values
+        fmt.Printf("Row %d: %v, %v, %v\n", i,
+            col0.ValueStr(i), col1.ValueStr(i), col2.ValueStr(i))
+    }
+}
+```
+
+### Parameterized Queries
+
+We can bind parameters in our queries using Arrow records:
+
+```go
+import (
+    "strings"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+// Create parameter schema and data
+paramSchema := arrow.NewSchema([]arrow.Field{
+    {Name: "param1", Type: arrow.PrimitiveTypes.Int64},
+}, nil)
+
+params, _, err := array.RecordFromJSON(memory.DefaultAllocator, paramSchema,
+    strings.NewReader(`[{"param1": 41}]`))
+if err != nil {
+    return err
+}
+defer params.Release()
+
+// Set query and bind parameters
+err = stmt.SetSqlQuery("SELECT ? + 1 AS the_answer")
+if err != nil {
+    return err
+}
+
+err = stmt.Prepare(ctx)
+if err != nil {
+    return err
+}
+
+err = stmt.Bind(ctx, params)
+if err != nil {
+    return err
+}
+
+reader, _, err := stmt.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader.Release()
+```
+
+### Ingesting Bulk Data
+
+The Go ADBC APIs offer methods for bulk data ingestion. We can insert Arrow data
+into a new database table:
+
+```go
+// Create Arrow table data
+schema := arrow.NewSchema([]arrow.Field{
+    {Name: "ints", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
+    {Name: "strs", Type: arrow.BinaryTypes.String, Nullable: true},
+}, nil)
+
+table, _, err := array.RecordFromJSON(memory.DefaultAllocator, schema,
+    strings.NewReader(`[{"ints": 1, "strs": "a"}, {"ints": 2, "strs": null}]`))
+if err != nil {
+    return err
+}
+defer table.Release()
+
+reader, err := array.NewRecordReader(schema, []arrow.Record{table})
+if err != nil {
+    return err
+}
+defer reader.Release()
+
+// Ingest the data
+count, err := adbc.IngestStream(ctx, conn, reader, "sample",
+    adbc.OptionValueIngestModeCreateAppend, adbc.IngestStreamOptions{})
+if err != nil {
+    return err
+}
+fmt.Printf("Ingested %d rows\n", count)
+
+// Verify the data
+stmt2, err := conn.NewStatement()
+if err != nil {
+    return err
+}
+defer stmt2.Close()
+
+err = stmt2.SetSqlQuery("SELECT COUNT(DISTINCT ints) FROM sample")
+if err != nil {
+    return err
+}
+
+reader2, _, err := stmt2.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader2.Release()
+```
+
+### Getting Database/Driver Metadata
+
+We can get information about the driver and the database:
+
+```go
+// Get driver info
+infoReader, err := conn.GetInfo(ctx, []adbc.InfoCode{
+    adbc.InfoVendorName,
+    adbc.InfoDriverName,
+})
+if err != nil {
+    return err
+}
+defer infoReader.Release()
+
+// Process the info results...
+for infoReader.Next() {
+    record := infoReader.Record()
+    // Extract vendor name, driver name, etc. from the record
+}
+```
+
+We can also query for tables and columns in the database:
+
+```go
+objectsReader, err := conn.GetObjects(ctx, adbc.ObjectDepthAll, nil, nil, nil, nil, nil)

Review Comment:
   Yes! Done in baa25e3037051885a001c6134570779ba70f06cd.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2254800000


##########
go/adbc/README.md:
##########
@@ -0,0 +1,308 @@
+<!---
+  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.
+-->
+
+# adbc
+
+The `adbc` package provides Go interface definitions for using Arrow data and databases, also known as [ADBC](https://arrow.apache.org/adbc/).
+
+## Getting Started
+
+To give a brief tour of what you can do with the `adbc` package, we'll show a brief example of using the [SQLite driver](https://arrow.apache.org/adbc/current/driver/sqlite.html).
+
+### Installation
+
+First, assuming you've already created a Go module, add the `drivermgr` package to your `go.mod` by running:
+
+```sh
+go get github.com/apache/arrow-adbc/go/adbc/drivermgr
+```
+
+### Imports
+
+For imports, all we really need is `github.com/apache/arrow-adbc/go/adbc/drivermgr` to start but we'll import a few more modules now because we'll use them later.
+
+```go
+package main
+
+import (
+    "context"
+    "fmt"
+    "strings"
+
+    "github.com/apache/arrow-adbc/go/adbc"
+    "github.com/apache/arrow-adbc/go/adbc/drivermgr"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+func GettingStarted() error {
+    ctx := context.Background()
+
+```
+
+### Setup
+
+Any program using ADBC will start with creating a `Database`, a `Connection` to that `Database`, and usually one or more `Statement` objects.
+
+First we create a `Database`, providing `adbc_driver_sqlite` as the name of the driver to load:
+
+```go
+    var drv drivermgr.Driver
+    db, err := drv.NewDatabase(map[string]string{
+        "driver": "adbc_driver_sqlite",
+    })
+    if err != nil {
+        return err
+    }
+    defer db.Close()
+```
+
+Using the `Database` instance we created above, we can now create a `Connection` with `Open`:
+
+```go
+    conn, err := db.Open(ctx)
+    if err != nil {
+        return err
+    }
+    defer conn.Close()
+```
+
+Before we can execute any queries, we need to create a `Statement` to manage them:
+
+```go
+    stmt, err := conn.NewStatement()
+    if err != nil {
+        return err
+    }
+    defer stmt.Close()
+```
+
+Now that we have a basic setup, we'll show some of the functionality.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+    err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+    if err != nil {
+        return err
+    }
+
+    reader, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader.Release()
+
+    for reader.Next() {
+        record := reader.Record()
+
+        // Extract our three columns
+        col0 := record.Column(0)
+        col1 := record.Column(1)
+        col2 := record.Column(2)
+
+        for i := 0; i < int(record.NumRows()); i++ {
+            fmt.Printf("Row %d: %v, %v, %v\n", i,
+                col0.ValueStr(i), col1.ValueStr(i), col2.ValueStr(i))
+        }
+    }
+```
+
+This prints:
+
+```text
+Row 0: 1, 2, Hello, world!
+```
+
+### Parameterized Queries
+
+We can bind Arrow records as parameters in our queries too:
+
+```go
+    // Create parameter schema and data
+    paramSchema := arrow.NewSchema([]arrow.Field{
+        {Name: "param1", Type: arrow.PrimitiveTypes.Int64},
+    }, nil)
+
+    params, _, err := array.RecordFromJSON(memory.DefaultAllocator, paramSchema,
+        strings.NewReader(`[{"param1": 41}]`))
+    if err != nil {
+        return err
+    }
+    defer params.Release()
+
+    // Set query and bind parameters
+    err = stmt.SetSqlQuery("SELECT ? + 1 AS the_answer")
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Prepare(ctx)
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Bind(ctx, params)
+    if err != nil {
+        return err
+    }
+
+    reader2, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader2.Release()
+```
+
+### Ingesting Bulk Data
+
+You may have noticed that it took a number of steps to bind Arrow data to a query.
+
+New in `adbc` 1.7.0, IngestStream is a utility that simplifies the five-step boilerplate of `NewStatement`, `SetOption`, `Bind`, `Execute`, and `Close`.

Review Comment:
   I will catch on eventually, thanks for the catch. Fixed in 28ac6113aac713c1dc736438418d5a4260bf1a31.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#issuecomment-3133904668

   I addressed a number of the comments around my incorrect/imprecise language by avoiding it altogether since it wasn't critical. I tested the code by extracting it into a test package (awk command included in README) so I feel pretty good about it now.
   
   @zeroshade can you give this a +1 if you like the direction?


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2254798260


##########
go/adbc/README.md:
##########
@@ -0,0 +1,308 @@
+<!---
+  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.
+-->
+
+# adbc
+
+The `adbc` package provides Go interface definitions for using Arrow data and databases, also known as [ADBC](https://arrow.apache.org/adbc/).
+
+## Getting Started
+
+To give a brief tour of what you can do with the `adbc` package, we'll show a brief example of using the [SQLite driver](https://arrow.apache.org/adbc/current/driver/sqlite.html).
+
+### Installation
+
+First, assuming you've already created a Go module, add the `drivermgr` package to your `go.mod` by running:
+
+```sh
+go get github.com/apache/arrow-adbc/go/adbc/drivermgr
+```
+
+### Imports
+
+For imports, all we really need is `github.com/apache/arrow-adbc/go/adbc/drivermgr` to start but we'll import a few more modules now because we'll use them later.
+
+```go
+package main
+
+import (
+    "context"
+    "fmt"
+    "strings"
+
+    "github.com/apache/arrow-adbc/go/adbc"
+    "github.com/apache/arrow-adbc/go/adbc/drivermgr"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+func GettingStarted() error {
+    ctx := context.Background()
+
+```
+
+### Setup
+
+Any program using ADBC will start with creating a `Database`, a `Connection` to that `Database`, and usually one or more `Statement` objects.
+
+First we create a `Database`, providing `adbc_driver_sqlite` as the name of the driver to load:
+
+```go
+    var drv drivermgr.Driver
+    db, err := drv.NewDatabase(map[string]string{
+        "driver": "adbc_driver_sqlite",
+    })
+    if err != nil {
+        return err
+    }
+    defer db.Close()
+```
+
+Using the `Database` instance we created above, we can now create a `Connection` with `Open`:
+
+```go
+    conn, err := db.Open(ctx)
+    if err != nil {
+        return err
+    }
+    defer conn.Close()
+```
+
+Before we can execute any queries, we need to create a `Statement` to manage them:
+
+```go
+    stmt, err := conn.NewStatement()
+    if err != nil {
+        return err
+    }
+    defer stmt.Close()
+```
+
+Now that we have a basic setup, we'll show some of the functionality.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+    err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+    if err != nil {
+        return err
+    }
+
+    reader, _, err := stmt.ExecuteQuery(ctx)

Review Comment:
   I agree, changed in c7092950d67b611a93e6171e61857ff5c337276e.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2231851948


##########
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`.

Review Comment:
   should we link to the ADBC docs for this?



##########
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()

Review Comment:
   put this inside of a function of some kind for the example, such as `func main()` or otherwise. Just so it's valid and easily copy and pastable
   
   Or separate the `import` section and the code into separate code blocks. It just looks awkward currently lol



##########
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()
+```
+
+In application code, the statement must be closed after usage or memory
+may leak. Use ``defer`` statements to ensure proper cleanup.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+if err != nil {
+    return err
+}
+
+reader, _, err := stmt.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader.Release()
+
+for reader.Next() {
+    record := reader.Record()
+    // Access columns by index
+    col0 := record.Column(0) // int64 array
+    col1 := record.Column(1) // float64 array
+    col2 := record.Column(2) // string array
+
+    // Process the data...
+    for i := 0; i < int(record.NumRows()); i++ {
+        // Access individual values
+        fmt.Printf("Row %d: %v, %v, %v\n", i,
+            col0.ValueStr(i), col1.ValueStr(i), col2.ValueStr(i))
+    }
+}
+```
+
+### Parameterized Queries
+
+We can bind parameters in our queries using Arrow records:
+
+```go
+import (
+    "strings"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+// Create parameter schema and data
+paramSchema := arrow.NewSchema([]arrow.Field{
+    {Name: "param1", Type: arrow.PrimitiveTypes.Int64},
+}, nil)
+
+params, _, err := array.RecordFromJSON(memory.DefaultAllocator, paramSchema,
+    strings.NewReader(`[{"param1": 41}]`))
+if err != nil {
+    return err
+}
+defer params.Release()
+
+// Set query and bind parameters
+err = stmt.SetSqlQuery("SELECT ? + 1 AS the_answer")
+if err != nil {
+    return err
+}
+
+err = stmt.Prepare(ctx)
+if err != nil {
+    return err
+}
+
+err = stmt.Bind(ctx, params)
+if err != nil {
+    return err
+}
+
+reader, _, err := stmt.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader.Release()
+```
+
+### Ingesting Bulk Data
+
+The Go ADBC APIs offer methods for bulk data ingestion. We can insert Arrow data
+into a new database table:
+
+```go
+// Create Arrow table data
+schema := arrow.NewSchema([]arrow.Field{
+    {Name: "ints", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
+    {Name: "strs", Type: arrow.BinaryTypes.String, Nullable: true},
+}, nil)
+
+table, _, err := array.RecordFromJSON(memory.DefaultAllocator, schema,
+    strings.NewReader(`[{"ints": 1, "strs": "a"}, {"ints": 2, "strs": null}]`))
+if err != nil {
+    return err
+}
+defer table.Release()
+
+reader, err := array.NewRecordReader(schema, []arrow.Record{table})
+if err != nil {
+    return err
+}
+defer reader.Release()
+
+// Ingest the data
+count, err := adbc.IngestStream(ctx, conn, reader, "sample",
+    adbc.OptionValueIngestModeCreateAppend, adbc.IngestStreamOptions{})
+if err != nil {
+    return err
+}
+fmt.Printf("Ingested %d rows\n", count)
+
+// Verify the data
+stmt2, err := conn.NewStatement()
+if err != nil {
+    return err
+}
+defer stmt2.Close()
+
+err = stmt2.SetSqlQuery("SELECT COUNT(DISTINCT ints) FROM sample")
+if err != nil {
+    return err
+}
+
+reader2, _, err := stmt2.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader2.Release()
+```
+
+### Getting Database/Driver Metadata
+
+We can get information about the driver and the database:
+
+```go
+// Get driver info
+infoReader, err := conn.GetInfo(ctx, []adbc.InfoCode{
+    adbc.InfoVendorName,
+    adbc.InfoDriverName,
+})
+if err != nil {
+    return err
+}
+defer infoReader.Release()
+
+// Process the info results...
+for infoReader.Next() {
+    record := infoReader.Record()
+    // Extract vendor name, driver name, etc. from the record
+}
+```
+
+We can also query for tables and columns in the database:
+
+```go
+objectsReader, err := conn.GetObjects(ctx, adbc.ObjectDepthAll, nil, nil, nil, nil, nil)

Review Comment:
   should we explain what those parameters are for?



##########
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`)

Review Comment:
   the scaffolding is in `internal/driverbase`. `pkg` is for wrapping drivers for use outside of Go, generating the C shared lib



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2254786994


##########
go/adbc/README.md:
##########
@@ -0,0 +1,308 @@
+<!---
+  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.
+-->
+
+# adbc
+
+The `adbc` package provides Go interface definitions for using Arrow data and databases, also known as [ADBC](https://arrow.apache.org/adbc/).
+
+## Getting Started
+
+To give a brief tour of what you can do with the `adbc` package, we'll show a brief example of using the [SQLite driver](https://arrow.apache.org/adbc/current/driver/sqlite.html).
+
+### Installation
+
+First, assuming you've already created a Go module, add the `drivermgr` package to your `go.mod` by running:
+
+```sh
+go get github.com/apache/arrow-adbc/go/adbc/drivermgr
+```
+
+### Imports
+
+For imports, all we really need is `github.com/apache/arrow-adbc/go/adbc/drivermgr` to start but we'll import a few more modules now because we'll use them later.
+
+```go
+package main
+
+import (
+    "context"
+    "fmt"
+    "strings"
+
+    "github.com/apache/arrow-adbc/go/adbc"
+    "github.com/apache/arrow-adbc/go/adbc/drivermgr"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+func GettingStarted() error {
+    ctx := context.Background()
+
+```
+
+### Setup
+
+Any program using ADBC will start with creating a `Database`, a `Connection` to that `Database`, and usually one or more `Statement` objects.
+
+First we create a `Database`, providing `adbc_driver_sqlite` as the name of the driver to load:
+
+```go
+    var drv drivermgr.Driver
+    db, err := drv.NewDatabase(map[string]string{
+        "driver": "adbc_driver_sqlite",
+    })
+    if err != nil {
+        return err
+    }
+    defer db.Close()
+```
+
+Using the `Database` instance we created above, we can now create a `Connection` with `Open`:
+
+```go
+    conn, err := db.Open(ctx)
+    if err != nil {
+        return err
+    }
+    defer conn.Close()
+```
+
+Before we can execute any queries, we need to create a `Statement` to manage them:
+
+```go
+    stmt, err := conn.NewStatement()
+    if err != nil {
+        return err
+    }
+    defer stmt.Close()
+```
+
+Now that we have a basic setup, we'll show some of the functionality.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+    err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+    if err != nil {
+        return err
+    }
+
+    reader, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader.Release()
+
+    for reader.Next() {
+        record := reader.Record()
+
+        // Extract our three columns
+        col0 := record.Column(0)
+        col1 := record.Column(1)
+        col2 := record.Column(2)
+
+        for i := 0; i < int(record.NumRows()); i++ {
+            fmt.Printf("Row %d: %v, %v, %v\n", i,
+                col0.ValueStr(i), col1.ValueStr(i), col2.ValueStr(i))
+        }
+    }
+```
+
+This prints:
+
+```text
+Row 0: 1, 2, Hello, world!
+```
+
+### Parameterized Queries
+
+We can bind Arrow records as parameters in our queries too:
+
+```go
+    // Create parameter schema and data
+    paramSchema := arrow.NewSchema([]arrow.Field{
+        {Name: "param1", Type: arrow.PrimitiveTypes.Int64},
+    }, nil)
+
+    params, _, err := array.RecordFromJSON(memory.DefaultAllocator, paramSchema,
+        strings.NewReader(`[{"param1": 41}]`))
+    if err != nil {
+        return err
+    }
+    defer params.Release()
+
+    // Set query and bind parameters
+    err = stmt.SetSqlQuery("SELECT ? + 1 AS the_answer")
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Prepare(ctx)
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Bind(ctx, params)
+    if err != nil {
+        return err
+    }
+
+    reader2, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader2.Release()
+```
+
+### Ingesting Bulk Data
+
+You may have noticed that it took a number of steps to bind Arrow data to a query.
+
+New in `adbc` 1.7.0, IngestStream is a utility that simplifies the five-step boilerplate of `NewStatement`, `SetOption`, `Bind`, `Execute`, and `Close`.
+Note that IngestStream is not part of the [ADBC Standard](https://arrow.apache.org/adbc/current/format/specification.html).
+
+Here we can use it to create a table from Arrow data.
+First, let's prepare some data.
+
+```go
+    // Create Arrow table data
+    schema := arrow.NewSchema([]arrow.Field{
+        {Name: "ints", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
+        {Name: "strs", Type: arrow.BinaryTypes.String, Nullable: true},
+    }, nil)
+
+    table, _, err := array.RecordFromJSON(memory.DefaultAllocator, schema,
+        strings.NewReader(`[{"ints": 1, "strs": "a"}, {"ints": 2, "strs": null}]`))
+    if err != nil {
+        return err
+    }
+    defer table.Release()
+
+    reader3, err := array.NewRecordReader(schema, []arrow.Record{table})
+    if err != nil {
+        return err
+    }
+    defer reader3.Release()
+```
+
+Now, we can use IngestStream:
+
+```go
+    // Ingest the data
+    count, err := adbc.IngestStream(ctx, conn, reader3, "sample",
+        adbc.OptionValueIngestModeCreateAppend, adbc.IngestStreamOptions{})
+    if err != nil {
+        return err
+    }
+    fmt.Printf("Ingested %d rows\n", count)
+```
+
+### Getting Database/Driver Metadata
+
+We can get information about the driver and the database:
+
+```go
+    // Get driver info
+    infoReader, err := conn.GetInfo(ctx, []adbc.InfoCode{
+        adbc.InfoVendorName,
+        adbc.InfoDriverName,
+    })
+    if err != nil {
+        return err
+    }
+    defer infoReader.Release()
+
+    // Process the info results...
+    for infoReader.Next() {
+        record := infoReader.Record()
+        // Extract vendor name, driver name, etc. from the record
+    }
+```
+
+We can also query for tables and columns in the database.
+
+Note: `GetObjects` takes an optional set of filters which control which objects are returned. We set them to `nil` here to return all objects.
+
+```go
+    objectsReader, err := conn.GetObjects(
+        ctx,
+        adbc.ObjectDepthAll,
+        nil, /* catalog *string */
+        nil, /* dbSchema *string */
+        nil, /* tableName *string */
+        nil, /* columnName *string */
+        nil,  /* tableType []string */
+    )
+    if err != nil {
+        return err
+    }
+    defer objectsReader.Release()
+
+    // Process the objects results to get catalog/schema/table information
+    for objectsReader.Next() {
+        record := objectsReader.Record()
+        // Navigate the nested structure for catalogs, schemas, tables, columns
+    }
+```
+
+We can get the Arrow schema of a table:
+
+```go
+    tableSchema, err := conn.GetTableSchema(ctx, nil, nil, "sample")
+    if err != nil {
+        return err
+    }
+
+    // tableSchema is an *arrow.Schema
+    fmt.Printf("Table schema: %s\n", tableSchema.String())
+```
+
+This prints:
+
+```text
+Table schema: schema:
+  fields: 2
+    - ints: type=int64, nullable
+    - strs: type=utf8, nullable
+```
+
+Finally, we close our GettingStarted, call it from `func main`, and handle any errors we returned:
+
+```go
+    return nil
+} // func GettingStarted
+
+func main() {
+   err := GettingStarted()
+
+    if err != nil {
+        fmt.Printf("Failed with error: %s", err)
+        os.Exit(1)
+    }
+}
+```
+
+If you would like to extract all the code above into a `.go` file, you can run,
+
+```sh
+awk '/```go/{flag=1;next}/```/{flag=0}flag' *.md > main.go
+```

Review Comment:
   Love this!



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2254789692


##########
go/adbc/README.md:
##########
@@ -0,0 +1,308 @@
+<!---
+  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.
+-->
+
+# adbc
+
+The `adbc` package provides Go interface definitions for using Arrow data and databases, also known as [ADBC](https://arrow.apache.org/adbc/).
+
+## Getting Started
+
+To give a brief tour of what you can do with the `adbc` package, we'll show a brief example of using the [SQLite driver](https://arrow.apache.org/adbc/current/driver/sqlite.html).
+
+### Installation
+
+First, assuming you've already created a Go module, add the `drivermgr` package to your `go.mod` by running:
+
+```sh
+go get github.com/apache/arrow-adbc/go/adbc/drivermgr
+```
+
+### Imports
+
+For imports, all we really need is `github.com/apache/arrow-adbc/go/adbc/drivermgr` to start but we'll import a few more modules now because we'll use them later.
+
+```go
+package main
+
+import (
+    "context"
+    "fmt"
+    "strings"
+
+    "github.com/apache/arrow-adbc/go/adbc"
+    "github.com/apache/arrow-adbc/go/adbc/drivermgr"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+func GettingStarted() error {
+    ctx := context.Background()
+
+```
+
+### Setup
+
+Any program using ADBC will start with creating a `Database`, a `Connection` to that `Database`, and usually one or more `Statement` objects.
+
+First we create a `Database`, providing `adbc_driver_sqlite` as the name of the driver to load:
+
+```go
+    var drv drivermgr.Driver
+    db, err := drv.NewDatabase(map[string]string{
+        "driver": "adbc_driver_sqlite",
+    })
+    if err != nil {
+        return err
+    }
+    defer db.Close()
+```
+
+Using the `Database` instance we created above, we can now create a `Connection` with `Open`:
+
+```go
+    conn, err := db.Open(ctx)
+    if err != nil {
+        return err
+    }
+    defer conn.Close()
+```
+
+Before we can execute any queries, we need to create a `Statement` to manage them:
+
+```go
+    stmt, err := conn.NewStatement()
+    if err != nil {
+        return err
+    }
+    defer stmt.Close()
+```
+
+Now that we have a basic setup, we'll show some of the functionality.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+    err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+    if err != nil {
+        return err
+    }
+
+    reader, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader.Release()
+
+    for reader.Next() {
+        record := reader.Record()
+
+        // Extract our three columns
+        col0 := record.Column(0)
+        col1 := record.Column(1)
+        col2 := record.Column(2)
+
+        for i := 0; i < int(record.NumRows()); i++ {
+            fmt.Printf("Row %d: %v, %v, %v\n", i,
+                col0.ValueStr(i), col1.ValueStr(i), col2.ValueStr(i))
+        }
+    }
+```
+
+This prints:
+
+```text
+Row 0: 1, 2, Hello, world!
+```
+
+### Parameterized Queries
+
+We can bind Arrow records as parameters in our queries too:
+
+```go
+    // Create parameter schema and data
+    paramSchema := arrow.NewSchema([]arrow.Field{
+        {Name: "param1", Type: arrow.PrimitiveTypes.Int64},
+    }, nil)
+
+    params, _, err := array.RecordFromJSON(memory.DefaultAllocator, paramSchema,
+        strings.NewReader(`[{"param1": 41}]`))
+    if err != nil {
+        return err
+    }
+    defer params.Release()
+
+    // Set query and bind parameters
+    err = stmt.SetSqlQuery("SELECT ? + 1 AS the_answer")
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Prepare(ctx)
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Bind(ctx, params)
+    if err != nil {
+        return err
+    }
+
+    reader2, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader2.Release()
+```
+
+### Ingesting Bulk Data
+
+You may have noticed that it took a number of steps to bind Arrow data to a query.
+
+New in `adbc` 1.7.0, IngestStream is a utility that simplifies the five-step boilerplate of `NewStatement`, `SetOption`, `Bind`, `Execute`, and `Close`.
+Note that IngestStream is not part of the [ADBC Standard](https://arrow.apache.org/adbc/current/format/specification.html).
+
+Here we can use it to create a table from Arrow data.
+First, let's prepare some data.
+
+```go
+    // Create Arrow table data
+    schema := arrow.NewSchema([]arrow.Field{
+        {Name: "ints", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
+        {Name: "strs", Type: arrow.BinaryTypes.String, Nullable: true},
+    }, nil)
+
+    table, _, err := array.RecordFromJSON(memory.DefaultAllocator, schema,
+        strings.NewReader(`[{"ints": 1, "strs": "a"}, {"ints": 2, "strs": null}]`))
+    if err != nil {
+        return err
+    }
+    defer table.Release()
+
+    reader3, err := array.NewRecordReader(schema, []arrow.Record{table})
+    if err != nil {
+        return err
+    }
+    defer reader3.Release()
+```
+
+Now, we can use IngestStream:
+
+```go
+    // Ingest the data
+    count, err := adbc.IngestStream(ctx, conn, reader3, "sample",
+        adbc.OptionValueIngestModeCreateAppend, adbc.IngestStreamOptions{})
+    if err != nil {
+        return err
+    }
+    fmt.Printf("Ingested %d rows\n", count)
+```
+
+### Getting Database/Driver Metadata
+
+We can get information about the driver and the database:
+
+```go
+    // Get driver info
+    infoReader, err := conn.GetInfo(ctx, []adbc.InfoCode{
+        adbc.InfoVendorName,
+        adbc.InfoDriverName,
+    })
+    if err != nil {
+        return err
+    }
+    defer infoReader.Release()
+
+    // Process the info results...
+    for infoReader.Next() {
+        record := infoReader.Record()
+        // Extract vendor name, driver name, etc. from the record
+    }
+```
+
+We can also query for tables and columns in the database.
+
+Note: `GetObjects` takes an optional set of filters which control which objects are returned. We set them to `nil` here to return all objects.
+
+```go
+    objectsReader, err := conn.GetObjects(
+        ctx,
+        adbc.ObjectDepthAll,
+        nil, /* catalog *string */
+        nil, /* dbSchema *string */
+        nil, /* tableName *string */
+        nil, /* columnName *string */
+        nil,  /* tableType []string */
+    )
+    if err != nil {
+        return err
+    }
+    defer objectsReader.Release()
+
+    // Process the objects results to get catalog/schema/table information
+    for objectsReader.Next() {
+        record := objectsReader.Record()
+        // Navigate the nested structure for catalogs, schemas, tables, columns
+    }
+```
+
+We can get the Arrow schema of a table:
+
+```go
+    tableSchema, err := conn.GetTableSchema(ctx, nil, nil, "sample")
+    if err != nil {
+        return err
+    }
+
+    // tableSchema is an *arrow.Schema
+    fmt.Printf("Table schema: %s\n", tableSchema.String())
+```
+
+This prints:
+
+```text
+Table schema: schema:
+  fields: 2
+    - ints: type=int64, nullable
+    - strs: type=utf8, nullable
+```
+
+Finally, we close our GettingStarted, call it from `func main`, and handle any errors we returned:
+
+```go
+    return nil
+} // func GettingStarted
+
+func main() {
+   err := GettingStarted()
+
+    if err != nil {
+        fmt.Printf("Failed with error: %s", err)
+        os.Exit(1)
+    }
+}
+```
+
+If you would like to extract all the code above into a `.go` file, you can run,
+
+```sh
+awk '/```go/{flag=1;next}/```/{flag=0}flag' *.md > main.go
+```

Review Comment:
   I was happy I could do this with a short one-liner.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2237911450


##########
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:
   Surprisingly, it's still the common convention of Go to just defer Close and ignore if it returns an error... 



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2240811248


##########
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()
+```
+
+In application code, the statement must be closed after usage or memory
+may leak. Use ``defer`` statements to ensure proper cleanup.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+if err != nil {
+    return err
+}
+
+reader, _, err := stmt.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader.Release()
+
+for reader.Next() {
+    record := reader.Record()
+    // Access columns by index
+    col0 := record.Column(0) // int64 array
+    col1 := record.Column(1) // float64 array
+    col2 := record.Column(2) // string array
+
+    // Process the data...
+    for i := 0; i < int(record.NumRows()); i++ {
+        // Access individual values
+        fmt.Printf("Row %d: %v, %v, %v\n", i,
+            col0.ValueStr(i), col1.ValueStr(i), col2.ValueStr(i))
+    }
+}
+```
+
+### Parameterized Queries
+
+We can bind parameters in our queries using Arrow records:
+
+```go
+import (
+    "strings"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+// Create parameter schema and data
+paramSchema := arrow.NewSchema([]arrow.Field{
+    {Name: "param1", Type: arrow.PrimitiveTypes.Int64},
+}, nil)
+
+params, _, err := array.RecordFromJSON(memory.DefaultAllocator, paramSchema,
+    strings.NewReader(`[{"param1": 41}]`))
+if err != nil {
+    return err
+}
+defer params.Release()
+
+// Set query and bind parameters
+err = stmt.SetSqlQuery("SELECT ? + 1 AS the_answer")
+if err != nil {
+    return err
+}
+
+err = stmt.Prepare(ctx)
+if err != nil {
+    return err
+}
+
+err = stmt.Bind(ctx, params)
+if err != nil {
+    return err
+}
+
+reader, _, err := stmt.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader.Release()
+```
+
+### Ingesting Bulk Data
+
+The Go ADBC APIs offer methods for bulk data ingestion. We can insert Arrow data
+into a new database table:
+
+```go
+// Create Arrow table data
+schema := arrow.NewSchema([]arrow.Field{
+    {Name: "ints", Type: arrow.PrimitiveTypes.Int64, Nullable: true},
+    {Name: "strs", Type: arrow.BinaryTypes.String, Nullable: true},
+}, nil)
+
+table, _, err := array.RecordFromJSON(memory.DefaultAllocator, schema,
+    strings.NewReader(`[{"ints": 1, "strs": "a"}, {"ints": 2, "strs": null}]`))
+if err != nil {
+    return err
+}
+defer table.Release()
+
+reader, err := array.NewRecordReader(schema, []arrow.Record{table})
+if err != nil {
+    return err
+}
+defer reader.Release()
+
+// Ingest the data
+count, err := adbc.IngestStream(ctx, conn, reader, "sample",
+    adbc.OptionValueIngestModeCreateAppend, adbc.IngestStreamOptions{})
+if err != nil {
+    return err
+}
+fmt.Printf("Ingested %d rows\n", count)
+
+// Verify the data
+stmt2, err := conn.NewStatement()
+if err != nil {
+    return err
+}
+defer stmt2.Close()
+
+err = stmt2.SetSqlQuery("SELECT COUNT(DISTINCT ints) FROM sample")
+if err != nil {
+    return err
+}
+
+reader2, _, err := stmt2.ExecuteQuery(ctx)
+if err != nil {
+    return err
+}
+defer reader2.Release()
+```
+
+### Getting Database/Driver Metadata
+
+We can get information about the driver and the database:
+
+```go
+// Get driver info
+infoReader, err := conn.GetInfo(ctx, []adbc.InfoCode{
+    adbc.InfoVendorName,
+    adbc.InfoDriverName,
+})
+if err != nil {
+    return err
+}
+defer infoReader.Release()
+
+// Process the info results...
+for infoReader.Next() {
+    record := infoReader.Record()
+    // Extract vendor name, driver name, etc. from the record
+}
+```
+
+We can also query for tables and columns in the database:
+
+```go
+objectsReader, err := conn.GetObjects(ctx, adbc.ObjectDepthAll, nil, nil, nil, nil, nil)

Review Comment:
   and fixed my copy paste error in dbf2c7a62d86d4892aba1425d33b147ae49f02d1.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2254772259


##########
go/adbc/README.md:
##########
@@ -0,0 +1,308 @@
+<!---
+  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.
+-->
+
+# adbc
+
+The `adbc` package provides Go interface definitions for using Arrow data and databases, also known as [ADBC](https://arrow.apache.org/adbc/).
+
+## Getting Started
+
+To give a brief tour of what you can do with the `adbc` package, we'll show a brief example of using the [SQLite driver](https://arrow.apache.org/adbc/current/driver/sqlite.html).
+
+### Installation
+
+First, assuming you've already created a Go module, add the `drivermgr` package to your `go.mod` by running:
+
+```sh
+go get github.com/apache/arrow-adbc/go/adbc/drivermgr
+```
+
+### Imports
+
+For imports, all we really need is `github.com/apache/arrow-adbc/go/adbc/drivermgr` to start but we'll import a few more modules now because we'll use them later.
+
+```go
+package main
+
+import (
+    "context"
+    "fmt"
+    "strings"
+
+    "github.com/apache/arrow-adbc/go/adbc"
+    "github.com/apache/arrow-adbc/go/adbc/drivermgr"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+func GettingStarted() error {
+    ctx := context.Background()
+
+```
+
+### Setup
+
+Any program using ADBC will start with creating a `Database`, a `Connection` to that `Database`, and usually one or more `Statement` objects.
+
+First we create a `Database`, providing `adbc_driver_sqlite` as the name of the driver to load:
+
+```go
+    var drv drivermgr.Driver
+    db, err := drv.NewDatabase(map[string]string{
+        "driver": "adbc_driver_sqlite",
+    })
+    if err != nil {
+        return err
+    }
+    defer db.Close()
+```
+
+Using the `Database` instance we created above, we can now create a `Connection` with `Open`:
+
+```go
+    conn, err := db.Open(ctx)
+    if err != nil {
+        return err
+    }
+    defer conn.Close()
+```
+
+Before we can execute any queries, we need to create a `Statement` to manage them:
+
+```go
+    stmt, err := conn.NewStatement()
+    if err != nil {
+        return err
+    }
+    defer stmt.Close()
+```
+
+Now that we have a basic setup, we'll show some of the functionality.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+    err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+    if err != nil {
+        return err
+    }
+
+    reader, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader.Release()
+
+    for reader.Next() {
+        record := reader.Record()
+
+        // Extract our three columns
+        col0 := record.Column(0)
+        col1 := record.Column(1)
+        col2 := record.Column(2)
+
+        for i := 0; i < int(record.NumRows()); i++ {
+            fmt.Printf("Row %d: %v, %v, %v\n", i,
+                col0.ValueStr(i), col1.ValueStr(i), col2.ValueStr(i))
+        }
+    }
+```
+
+This prints:
+
+```text
+Row 0: 1, 2, Hello, world!
+```
+
+### Parameterized Queries
+
+We can bind Arrow records as parameters in our queries too:
+
+```go
+    // Create parameter schema and data
+    paramSchema := arrow.NewSchema([]arrow.Field{
+        {Name: "param1", Type: arrow.PrimitiveTypes.Int64},
+    }, nil)
+
+    params, _, err := array.RecordFromJSON(memory.DefaultAllocator, paramSchema,
+        strings.NewReader(`[{"param1": 41}]`))
+    if err != nil {
+        return err
+    }
+    defer params.Release()
+
+    // Set query and bind parameters
+    err = stmt.SetSqlQuery("SELECT ? + 1 AS the_answer")
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Prepare(ctx)
+    if err != nil {
+        return err
+    }
+
+    err = stmt.Bind(ctx, params)
+    if err != nil {
+        return err
+    }
+
+    reader2, _, err := stmt.ExecuteQuery(ctx)
+    if err != nil {
+        return err
+    }
+    defer reader2.Release()
+```
+
+### Ingesting Bulk Data
+
+You may have noticed that it took a number of steps to bind Arrow data to a query.
+
+New in `adbc` 1.7.0, IngestStream is a utility that simplifies the five-step boilerplate of `NewStatement`, `SetOption`, `Bind`, `Execute`, and `Close`.

Review Comment:
   for go, the standard convention is to use the `v` prefix for versions.



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "zeroshade (via GitHub)" <gi...@apache.org>.
zeroshade commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2254761792


##########
go/adbc/README.md:
##########
@@ -0,0 +1,308 @@
+<!---
+  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.
+-->
+
+# adbc
+
+The `adbc` package provides Go interface definitions for using Arrow data and databases, also known as [ADBC](https://arrow.apache.org/adbc/).
+
+## Getting Started
+
+To give a brief tour of what you can do with the `adbc` package, we'll show a brief example of using the [SQLite driver](https://arrow.apache.org/adbc/current/driver/sqlite.html).
+
+### Installation
+
+First, assuming you've already created a Go module, add the `drivermgr` package to your `go.mod` by running:
+
+```sh
+go get github.com/apache/arrow-adbc/go/adbc/drivermgr
+```
+
+### Imports
+
+For imports, all we really need is `github.com/apache/arrow-adbc/go/adbc/drivermgr` to start but we'll import a few more modules now because we'll use them later.
+
+```go
+package main
+
+import (
+    "context"
+    "fmt"
+    "strings"
+
+    "github.com/apache/arrow-adbc/go/adbc"
+    "github.com/apache/arrow-adbc/go/adbc/drivermgr"
+    "github.com/apache/arrow-go/v18/arrow"
+    "github.com/apache/arrow-go/v18/arrow/array"
+    "github.com/apache/arrow-go/v18/arrow/memory"
+)
+
+func GettingStarted() error {
+    ctx := context.Background()
+
+```
+
+### Setup
+
+Any program using ADBC will start with creating a `Database`, a `Connection` to that `Database`, and usually one or more `Statement` objects.
+
+First we create a `Database`, providing `adbc_driver_sqlite` as the name of the driver to load:
+
+```go
+    var drv drivermgr.Driver
+    db, err := drv.NewDatabase(map[string]string{
+        "driver": "adbc_driver_sqlite",
+    })
+    if err != nil {
+        return err
+    }
+    defer db.Close()
+```
+
+Using the `Database` instance we created above, we can now create a `Connection` with `Open`:
+
+```go
+    conn, err := db.Open(ctx)
+    if err != nil {
+        return err
+    }
+    defer conn.Close()
+```
+
+Before we can execute any queries, we need to create a `Statement` to manage them:
+
+```go
+    stmt, err := conn.NewStatement()
+    if err != nil {
+        return err
+    }
+    defer stmt.Close()
+```
+
+Now that we have a basic setup, we'll show some of the functionality.
+
+### Executing a Query
+
+We can execute a query and get the results as Arrow data:
+
+```go
+    err = stmt.SetSqlQuery("SELECT 1, 2.0, 'Hello, world!'")
+    if err != nil {
+        return err
+    }
+
+    reader, _, err := stmt.ExecuteQuery(ctx)

Review Comment:
   instead of using `_` here, should we use `n` and do something like `fmt.Println("NumRows: ", n)` to indicate what that return value is?



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on code in PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#discussion_r2237906121


##########
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()

Review Comment:
   yeah, I'm not sure I love any one way of doing this. I'll try modelling it after how the literate readme for C++ is done and see if we like it (even if we can't test it).



-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: improve go docs by adding a readme [arrow-adbc]

Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on PR #3204:
URL: https://github.com/apache/arrow-adbc/pull/3204#issuecomment-3129975395

   Thanks for the reviews.
   
   After creating this PR, I found out you can do _some_ degree of package-level documentation in source code headers and also in standalone doc.go files but you're limited to only a single heading level which I don't think is ideal. I'm going to keep going with the README.md approach since it seems to work and address the feedback.


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org