flightsql

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

flightsql - A FlightSQL driver for the database/sql package

Go Reference

Golang database/sql driver for FlightSQL.

Arrow Flight SQL is a protocol for interacting with SQL databases using the Arrow in-memory format and the Flight RPC framework.

Technical Details

This package is a thin wrapper over the ADBC database/sql driver wrapper, which is itself database/sql wrapper driver for any ADBC driver.

This package simply registers the FlightSQL ADBC driver with the database/sql package. Understanding ADBC is not necessary to use this driver.

Example

package main

import (
	"database/sql"
	_ "github.com/apache/arrow-adbc/go/adbc/sqldriver/flightsql"
)

func main() {
	db, err := sql.Open("flightsql", "uri=grpc://localhost:12345")
	if err != nil {
		panic(err)
	}

	if err = db.Ping(); err != nil {
		panic(err)
	}
}

Documentation

Overview

Example
package main

import (
	"database/sql"

	_ "github.com/apache/arrow-adbc/go/adbc/sqldriver/flightsql"
)

func main() {
	// Be sure to import the driver first:
	// import _ "github.com/apache/arrow-adbc/go/adbc/sqldriver/flightsql"

	db, err := sql.Open("flightsql", "uri=grpc://localhost:12345")
	if err != nil {
		panic(err)
	}

	if err = db.Ping(); err != nil {
		panic(err)
	}
}
Output:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL