polypheny

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

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Polypheny-DB Go Driver

A Polypheny-DB Driver for the Go programming language which supports multiple models and query languages.

Installation

To install and use the Go driver in a project, simply import this repo and the sql package of Go and then run go mod tidy. User may also need the context package.

import (
    _ "github.com/polypheny/Polypheny-Go-Driver"
    "database/sql"
    "context"
)

A demo on how to use this driver can be found in this repo.

An in-depth and more detailed documentation can be found here.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

We highly welcome your contributions to the Polypheny Go Driver. If you would like to contribute, please fork the repository and submit your changes as a pull request. Please consult our Admin Repository and our Website for guidelines and additional information.

Please note that we have a code of conduct. Please follow it in all your interactions with the project.

License

The Apache 2.0 License

Documentation

Index

Constants

View Source
const QueryDelimiter = ":"

The delimiter between query language name and the actual query

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgSpec

type ArgSpec struct {
	// contains filtered or unexported fields
}

type ClientError

type ClientError struct {
	// contains filtered or unexported fields
}

func (*ClientError) Error

func (e *ClientError) Error() string

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

Connector implements the driver.Connector interface

func (*Connector) Connect

func (c *Connector) Connect(context.Context) (driver.Conn, error)

Connect connects to a Polypheny server and returns PolyphenyConn which implements driver.Conn

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

Driver retuens a PolyphenyDriver

type PolyphenyConn

type PolyphenyConn struct {
	// contains filtered or unexported fields
}

PolyphenyConn implements driver.Conn

func (*PolyphenyConn) Begin

func (conn *PolyphenyConn) Begin() (driver.Tx, error)

Begin starts a new transaction TODO: add support to ConnBeginTx Deprecated

func (*PolyphenyConn) BeginTx

func (conn *PolyphenyConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

BeginTx starts a transaction

func (*PolyphenyConn) Close

func (conn *PolyphenyConn) Close() error

Close will close the network connection to Polypheny server TODO: add support to timeout

func (*PolyphenyConn) Exec

func (conn *PolyphenyConn) Exec(query string, args []driver.Value) (driver.Result, error)

Exec executes a query that doesn't return data TODO: add fetch size, namespace and args support. TODO: for args support, can we first prepare it and then exec? Deprecated

func (*PolyphenyConn) ExecContext

func (conn *PolyphenyConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)

ExecContext executes a query that doesn't return data under Context

TODO add fetch size, namespace and args support. TODO for args support, can we first prepare it and then exec?

func (*PolyphenyConn) IsValid

func (conn *PolyphenyConn) IsValid() bool

IsValid implements Validator interface

func (*PolyphenyConn) Ping

func (conn *PolyphenyConn) Ping(ctx context.Context) error

Ping implmenets Pinger

func (*PolyphenyConn) Prepare

func (conn *PolyphenyConn) Prepare(query string) (driver.Stmt, error)

Prepare a statement

func (*PolyphenyConn) Query

func (conn *PolyphenyConn) Query(query string, args []driver.Value) (driver.Rows, error)

Exec executes a query that doesn't return data TODO: add fetch size, namespace and args support. TODO: for args support, can we first prepare it and then exec? Deprecated

func (*PolyphenyConn) QueryContext

func (conn *PolyphenyConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)

QueryContext executes a query that returns data under Context

TODO add fetch size, namespace and args support. TODO for args support, can we first prepare it and then exec?

type PolyphenyDriver

type PolyphenyDriver struct{}

PolyphenyDriver implements driver.Driver and DriverContext interface

func (PolyphenyDriver) Open

func (d PolyphenyDriver) Open(name string) (driver.Conn, error)

Open will return a PolyphenyConn which implements driver.Conn and represents a Connection to Polypheny server The name, also called DSN, has the following format: addr:port,user:password

func (PolyphenyDriver) OpenConnector

func (d PolyphenyDriver) OpenConnector(name string) (driver.Connector, error)

OpenConnector will return a Connector

type PolyphenyResult

type PolyphenyResult struct {
	// contains filtered or unexported fields
}

PolyphenyResult implements driver.Result and represents the results of queries that don't return data

func (*PolyphenyResult) LastInsertId

func (r *PolyphenyResult) LastInsertId() (int64, error)

LastInsertId returns the ID of the last inserted row TODO: does Polypheny support this at present?

func (*PolyphenyResult) RowsAffected

func (r *PolyphenyResult) RowsAffected() (int64, error)

RowsAffected returns the number of affected rows of a query

type PolyphenyRows

type PolyphenyRows struct {
	// contains filtered or unexported fields
}

PolyphenyRows implements driver.Rows and represents the results of queries that return data

func (*PolyphenyRows) Close

func (r *PolyphenyRows) Close() error

Close will close the Rows iterator

func (*PolyphenyRows) Columns

func (r *PolyphenyRows) Columns() []string

Columns returns the names of columns of a query

func (*PolyphenyRows) Next

func (r *PolyphenyRows) Next(dest []driver.Value) error

Next iterates over the Rows

type PolyphenyTranaction

type PolyphenyTranaction struct {
	// contains filtered or unexported fields
}

func (*PolyphenyTranaction) Commit

func (tx *PolyphenyTranaction) Commit() error

func (*PolyphenyTranaction) Rollback

func (tx *PolyphenyTranaction) Rollback() error

type PreparedStatement

type PreparedStatement struct {
	// contains filtered or unexported fields
}

PreparedStatement implments Stmt, StmtExecContext and StmtQueryContext Deprecated functions, such as Exec and Query, are also implemented for compatibility, but they are deprecated.

func (*PreparedStatement) Close

func (stmt *PreparedStatement) Close() error

Close closes the statement

func (*PreparedStatement) Exec

func (stmt *PreparedStatement) Exec(args []driver.Value) (driver.Result, error)

Exec executes a query that doesn't return data TODO: add support to FetchSize Deprecated

func (*PreparedStatement) ExecContext

func (stmt *PreparedStatement) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)

ExecContext executes a query that doesn't return data under Context

TODO add fetch size, namespace and args support. TODO for args support, can we first prepare it and then exec?

func (*PreparedStatement) NumInput

func (stmt *PreparedStatement) NumInput() int

NumInput returns the number of parameters

func (*PreparedStatement) Query

func (stmt *PreparedStatement) Query(args []driver.Value) (driver.Rows, error)

Query executes a query that returns data TODO: add support to FetchSize Deprecated

func (*PreparedStatement) QueryContext

func (stmt *PreparedStatement) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)

QueryContext executes a query that returns data under Context

TODO add fetch size, namespace and args support. TODO for args support, can we first prepare it and then exec?

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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