Documentation ¶
Index ¶
- Variables
- func IsScanValue(v interface{}) bool
- func IsValue(v interface{}) bool
- type ColumnConverter
- type Conn
- type ConnBeginTx
- type ConnPrepareContext
- type Connector
- type Driver
- type Execer
- type ExecerContext
- type IsolationLevel
- type NamedValue
- type NotNull
- type Null
- type Pinger
- type Queryer
- type QueryerContext
- type Result
- type Rows
- type RowsAffected
- type RowsColumnTypeDatabaseTypeName
- type RowsColumnTypeLength
- type RowsColumnTypeNullable
- type RowsColumnTypePrecisionScale
- type RowsColumnTypeScanType
- type RowsNextResultSet
- type Stmt
- type StmtExecContext
- type StmtQueryContext
- type Tx
- type TxOptions
- type Value
- type ValueConverter
- type Valuer
Constants ¶
This section is empty.
Variables ¶
var Bool boolType
Bool the compatible value of Bool in 'database/sql/driver' package.
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.
var ErrBadConn = errors.New("driver: bad connection")
ErrBadConn the compatible value of ErrBadConn in 'database/sql/driver' package.
var ErrSkip = errors.New("driver: skip fast-path; continue as if unimplemented")
ErrSkip the compatible value of ErrSkip in 'database/sql/driver' package.
var Int32 int32Type
Int32 is a ValueConverter that converts input values to int64, respecting the limits of an int32 value.
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.
Types ¶
type ColumnConverter ¶
type ColumnConverter interface {
ColumnConverter(idx int) ValueConverter
}
ColumnConverter the compatible interface of ColumnConverter in 'database/sql/driver' package.
type ConnBeginTx ¶
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
Connector the compatible interface of Connector 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 ¶
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 ¶
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 ¶
ConvertValue the compatible method of ConvertValue 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 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 ¶
RowsColumnTypeDatabaseTypeName the compatible interface of RowsColumnTypeDatabaseTypeName in 'database/sql/driver' package.
type RowsColumnTypeLength ¶
RowsColumnTypeLength the compatible interface of RowsColumnTypeLength in 'database/sql/driver' package.
type RowsColumnTypeNullable ¶
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 ¶
RowsColumnTypeScanType the compatible interface of RowsColumnTypeScanType in 'database/sql/driver' package.
type RowsNextResultSet ¶
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 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 ¶
ValueConverter the compatible interface of ValueConverter in 'database/sql/driver' package.