restsql

package module
v0.0.0-...-ca81a23 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

Go-SQL-REST-Driver

godoc Build Status Go Report Card

A simple driver for Go's database/sql package for SQL over REST API endpoints, such as those found within the RestAssured Query Gateway.

Installation

Install:

go get -u github.com/adaptant-labs/go-sql-rest-driver

Usage

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/")

Online Documentation

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.

Acknowledgements

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 731678.

License

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.

Documentation

Overview

Package restsql provides a driver for Go's database/sql package supporting SQL over REST API endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RESTSQLDriver

type RESTSQLDriver struct {
}

RESTSQLDriver is exported to make the driver directly accessible where needed. General usage is expected to be constrained to the database/sql APIs.

func (RESTSQLDriver) Open

func (d RESTSQLDriver) Open(url string) (driver.Conn, error)

Open prepares a destination URL endpoint that raw queries are appended to. The actual establishment of the connection is deferred until Query time.

Jump to

Keyboard shortcuts

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