driver

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bool boolType

Bool the compatible value of Bool in 'database/sql/driver' package.

View Source
var DefaultParameterConverter defaultConverter

DefaultParameterConverter is the default implementation of ValueConverter that's used when a Stmt doesn't implement ColumnConverter.

DefaultParameterConverter returns its argument directly if IsValue(arg). Otherwise, if the argument implements Valuer, its Value method is used to return a Value. As a fallback, the provided argument's underlying type is used to convert it to a Value: underlying integer types are converted to int64, floats to float64, bool, string, and []byte to themselves. If the argument is a nil pointer, ConvertValue returns a nil Value. If the argument is a non-nil pointer, it is dereferenced and ConvertValue is called recursively. Other types are an error.

View Source
var ErrBadConn = errors.New("driver: bad connection")

ErrBadConn the compatible value of ErrBadConn in 'database/sql/driver' package.

View Source
var ErrSkip = errors.New("driver: skip fast-path; continue as if unimplemented")

ErrSkip the compatible value of ErrSkip in 'database/sql/driver' package.

View Source
var Int32 int32Type

Int32 is a ValueConverter that converts input values to int64, respecting the limits of an int32 value.

View Source
var String stringType

String is a ValueConverter that converts its input to a string. If the value is already a string or []byte, it's unchanged. If the value is of another type, conversion to string is done with fmt.Sprintf("%v", v).

Functions

func IsScanValue

func IsScanValue(v interface{}) bool

IsScanValue is equivalent to IsValue. It exists for compatibility.

func IsValue

func IsValue(v interface{}) bool

IsValue reports whether v is a valid Value parameter type.

Types

type ColumnConverter

type ColumnConverter interface {
	ColumnConverter(idx int) ValueConverter
}

ColumnConverter the compatible interface of ColumnConverter in 'database/sql/driver' package.

type Conn

type Conn interface {
	Prepare(query string) (Stmt, error)
	Close() error
	Begin() (Tx, error)
}

Conn the compatible interface of Conn in 'database/sql/driver' package.

type ConnBeginTx

type ConnBeginTx interface {
	BeginTx(ctx context.Context, opts TxOptions) (Tx, error)
}

ConnBeginTx the compatible interface of ConnBeginTx in 'database/sql/driver' package.

type ConnPrepareContext

type ConnPrepareContext interface {
	PrepareContext(ctx context.Context, query string) (Stmt, error)
}

ConnPrepareContext the compatible interface of ConnPrepareContext in 'database/sql/driver' package.

type Connector added in v1.1.8

type Connector interface {
	Connect(context.Context) (Conn, error)
	Driver() Driver
}

Connector the compatible interface of Connector in 'database/sql/driver' package.

type Driver

type Driver interface {
	Open(name string) (Conn, error)
}

Driver the compatible interface of Driver in 'database/sql/driver' package.

type Execer

type Execer interface {
	Exec(query string, args []Value) (Result, error)
}

Execer the compatible interface of Execer in 'database/sql/driver' package.

type ExecerContext

type ExecerContext interface {
	ExecContext(ctx context.Context, query string, args []NamedValue) (Result, error)
}

ExecerContext the compatible interface of ExecerContext in 'database/sql/driver' package.

type IsolationLevel

type IsolationLevel int

IsolationLevel the compatible type of IsolationLevel in 'database/sql/driver' package.

type NamedValue

type NamedValue struct {
	Name    string
	Ordinal int
	Value   Value
}

NamedValue the compatible structure of NamedValue in 'database/sql/driver' package.

type NotNull

type NotNull struct {
	Converter ValueConverter
}

NotNull is a type that implements ValueConverter by disallowing nil values but otherwise delegating to another ValueConverter.

func (NotNull) ConvertValue

func (n NotNull) ConvertValue(v interface{}) (Value, error)

ConvertValue the compatible method of ConvertValue in 'database/sql/driver' package.

type Null

type Null struct {
	Converter ValueConverter
}

Null is a type that implements ValueConverter by allowing nil values but otherwise delegating to another ValueConverter.

func (Null) ConvertValue

func (n Null) ConvertValue(v interface{}) (Value, error)

ConvertValue the compatible method of ConvertValue in 'database/sql/driver' package.

type Pinger

type Pinger interface {
	Ping(ctx context.Context) error
}

Pinger the compatible interface of Pinger in 'database/sql/driver' package.

type Queryer

type Queryer interface {
	Query(query string, args []Value) (Rows, error)
}

Queryer the compatible interface of Queryer in 'database/sql/driver' package.

type QueryerContext

type QueryerContext interface {
	QueryContext(ctx context.Context, query string, args []NamedValue) (Rows, error)
}

QueryerContext the compatible interface of QueryerContext in 'database/sql/driver' package.

type Result

type Result interface {
	LastInsertId() (int64, error)
	RowsAffected() (int64, error)
}

Result the compatible interface of Result in 'database/sql/driver' package.

type Rows

type Rows interface {
	Columns() []string
	Close() error
	Next(dest []Value) error
}

Rows the compatible interface of Rows in 'database/sql/driver' package.

type RowsAffected

type RowsAffected int64

RowsAffected the compatible type of RowsAffected in 'database/sql/driver' package.

func (RowsAffected) LastInsertId

func (RowsAffected) LastInsertId() (int64, error)

LastInsertId the compatible method of LastInsertId in 'database/sql/driver' package.

func (RowsAffected) RowsAffected

func (v RowsAffected) RowsAffected() (int64, error)

RowsAffected the compatible method of RowsAffected in 'database/sql/driver' package.

type RowsColumnTypeDatabaseTypeName

type RowsColumnTypeDatabaseTypeName interface {
	Rows
	ColumnTypeDatabaseTypeName(index int) string
}

RowsColumnTypeDatabaseTypeName the compatible interface of RowsColumnTypeDatabaseTypeName in 'database/sql/driver' package.

type RowsColumnTypeLength

type RowsColumnTypeLength interface {
	Rows
	ColumnTypeLength(index int) (length int64, ok bool)
}

RowsColumnTypeLength the compatible interface of RowsColumnTypeLength in 'database/sql/driver' package.

type RowsColumnTypeNullable

type RowsColumnTypeNullable interface {
	Rows
	ColumnTypeNullable(index int) (nullable, ok bool)
}

RowsColumnTypeNullable the compatible interface of RowsColumnTypeNullable in 'database/sql/driver' package.

type RowsColumnTypePrecisionScale

type RowsColumnTypePrecisionScale interface {
	Rows
	ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)
}

RowsColumnTypePrecisionScale the compatible interface of RowsColumnTypePrecisionScale in 'database/sql/driver' package.

type RowsColumnTypeScanType

type RowsColumnTypeScanType interface {
	Rows
	ColumnTypeScanType(index int) reflect.Type
}

RowsColumnTypeScanType the compatible interface of RowsColumnTypeScanType in 'database/sql/driver' package.

type RowsNextResultSet

type RowsNextResultSet interface {
	Rows
	HasNextResultSet() bool
	NextResultSet() error
}

RowsNextResultSet the compatible interface of RowsNextResultSet in 'database/sql/driver' package.

type Stmt

type Stmt interface {
	Close() error
	NumInput() int
	Exec(args []Value) (Result, error)
	Query(args []Value) (Rows, error)
}

Stmt the compatible interface of Stmt in 'database/sql/driver' package.

type StmtExecContext

type StmtExecContext interface {
	ExecContext(ctx context.Context, args []NamedValue) (Result, error)
}

StmtExecContext the compatible interface of StmtExecContext in 'database/sql/driver' package.

type StmtQueryContext

type StmtQueryContext interface {
	QueryContext(ctx context.Context, args []NamedValue) (Rows, error)
}

StmtQueryContext the compatible interface of StmtQueryContext in 'database/sql/driver' package.

type Tx

type Tx interface {
	Commit() error
	Rollback() error
}

Tx the compatible interface of Tx in 'database/sql/driver' package.

type TxOptions

type TxOptions struct {
	Isolation IsolationLevel
	ReadOnly  bool
}

TxOptions the compatible structure of TxOptions in 'database/sql/driver' package.

type Value

type Value interface{}

Value the compatible interface of Value in 'database/sql/driver' package.

type ValueConverter

type ValueConverter interface {
	ConvertValue(v interface{}) (Value, error)
}

ValueConverter the compatible interface of ValueConverter in 'database/sql/driver' package.

type Valuer

type Valuer interface {
	Value() (Value, error)
}

Valuer the compatible interface of Valuer in 'database/sql/driver' package.

Jump to

Keyboard shortcuts

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