A simple driver for Go's database/sql package for SQL over REST API endpoints, such as those found within the RestAssured Query Gateway.
Install:
go get -u github.com/adaptant-labs/go-sql-rest-driver
Go SQL REST Driver is a limited implementation of Go's database/sql/driver
interface. You only need to import the driver and can then use the database/sql
API.
Use mysql
as driverName
and a valid REST API Endpoint:
import "database/sql"
import _ "github.com/adaptant-labs/go-sql-rest-driver"
db, err := sql.Open("restsql", "http://localhost:9000/query/v1/")
Limited API documentation for the driver interface itself is provided through godoc, this can be accessed
directly on the package entry
in the godoc package repository. In general, however, the database/sql
API should always be the main method of invocation.
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 731678.
go-sql-rest-driver is licensed under the terms of the Apache 2.0 license, the full version of which can be found in the LICENSE file included in the distribution.