thundrardb

package
v2.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(d driver.Driver) driver.Driver

Wrap wraps the SQL driver Returned driver should be registered to be able to use

Types

type ConnWrapper

type ConnWrapper struct {
	Conn driver.Conn
	// contains filtered or unexported fields
}

ConnWrapper wraps sql driver.Conn

func (*ConnWrapper) Begin

func (c *ConnWrapper) Begin() (driver.Tx, error)

Begin starts and returns a new transaction

func (*ConnWrapper) BeginTx

func (c *ConnWrapper) BeginTx(ctx context.Context, opts driver.TxOptions) (tx driver.Tx, err error)

BeginTx starts and returns a new transaction with context and and TxOptions

func (*ConnWrapper) Close

func (c *ConnWrapper) Close() error

Close closes connection in wrapper

func (*ConnWrapper) Exec

func (c *ConnWrapper) Exec(query string, args []driver.Value) (res driver.Result, err error)

Exec wraps the driver.execer.Exec and starts a new span.

func (*ConnWrapper) ExecContext

func (c *ConnWrapper) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (res driver.Result, err error)

ExecContext wraps the driver.ExecerContext.ExecContext and starts a new span. The newly created span will be a child of the span whose context is is passed using the ctx parameter

func (*ConnWrapper) Ping

func (c *ConnWrapper) Ping(ctx context.Context) (err error)

Ping wraps driver.Pinger.Ping

func (*ConnWrapper) Prepare

func (c *ConnWrapper) Prepare(query string) (driver.Stmt, error)

Prepare creates a prepared statement and wraps it

func (*ConnWrapper) PrepareContext

func (c *ConnWrapper) PrepareContext(ctx context.Context, query string) (stmt driver.Stmt, err error)

PrepareContext creates a prepared statement and wraps it

func (*ConnWrapper) Query

func (c *ConnWrapper) Query(query string, args []driver.Value) (rows driver.Rows, err error)

Query wraps the driver.Queryer.Query and starts a new span.

func (*ConnWrapper) QueryContext

func (c *ConnWrapper) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (rows driver.Rows, err error)

QueryContext wraps the driver.Queryer.Query and starts a new span. The newly created span will be a child of the span whose context is is passed using the ctx parameter

type DriverWrapper

type DriverWrapper struct {
	Driver driver.Driver
}

DriverWrapper wraps sql driver.Driver

func (*DriverWrapper) Open

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

Open opens a new connection and wraps connection for mysql and postgresql Returns connection as it is for other drivers

type StmtWrapper

type StmtWrapper struct {
	Stmt driver.Stmt
	// contains filtered or unexported fields
}

StmtWrapper wraps sql driver.Stmt with context

func (StmtWrapper) Close

func (s StmtWrapper) Close() (err error)

Close wraps driver.Stmt.Close

func (StmtWrapper) Exec

func (s StmtWrapper) Exec(args []driver.Value) (res driver.Result, err error)

Exec wraps the driver.Stmt.Exec and starts a new span.

func (StmtWrapper) ExecContext

func (s StmtWrapper) ExecContext(ctx context.Context, args []driver.NamedValue) (res driver.Result, err error)

ExecContext wraps the driver.StmtExecContext.ExecContext and starts a new span. The newly created span will be a child of the span whose context is is passed using the ctx parameter

func (StmtWrapper) NumInput

func (s StmtWrapper) NumInput() int

NumInput wraps driver.Stmt.NumInput

func (StmtWrapper) Query

func (s StmtWrapper) Query(args []driver.Value) (rows driver.Rows, err error)

Query wraps the driver.Stmt.Query and starts a new span.

func (StmtWrapper) QueryContext

func (s StmtWrapper) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error)

QueryContext wraps the driver.StmtQueryContext.QueryContext and starts a new span. The newly created span will be a child of the span whose context is is passed using the ctx parameter

Jump to

Keyboard shortcuts

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