Versions in this module Expand all Collapse all v0 v0.2.0 Sep 30, 2023 Changes in this version + var ErrorNotFoundSequence = errors.New("sequence instance not found") + var ErrorNotSequenceType = errors.New("sequence type not found") + func BuildAutoIncrementName(table string) string + func CompareValue(a, b Value) int + func RegisterFunc(name string, f Func) + func RegisterSchemaLoader(l SchemaLoader) + func RegisterSequence(name string, supplier SequenceSupplier) + func RegisterSequenceManager(l SequenceManager) + func ValidateFunction(ctx context.Context, f Func, strict bool) bool + type Callable interface + Call func(ctx context.Context, sql string, args ...Value) (res Result, warn uint16, err error) + CallFieldList func(ctx context.Context, table, wildcard string) ([]Field, error) + type ColumnMetadata struct + CaseSensitive bool + DataType string + Generated bool + Name string + Ordinal string + PrimaryKey bool + type Context struct + C FrontConn + Data []byte + Stmt *Stmt + func (c Context) GetArgs() []Value + func (c Context) GetQuery() string + func (c Context) Value(key interface{}) interface{} + type ContextKeyEnableLocalComputation struct + type ContextKeySQL struct + type ContextKeySchema struct + type ContextKeyServerVersion struct + type ContextKeyTenant struct + type ContextKeyTransientVariables struct + type DB interface + Capacity func() int + ID func() string + IdleTimeout func() time.Duration + MaxCapacity func() int + NodeConn func() NodeConn + SetCapacity func(capacity int) error + SetIdleTimeout func(idleTimeout time.Duration) error + SetMaxCapacity func(maxCapacity int) error + SetWeight func(weight Weight) error + Variable func(ctx context.Context, name string) (interface{}, error) + Weight func() Weight + type Dataset interface + Fields func() ([]Field, error) + Next func() (Row, error) + type EnhancedSequence interface + CurrentVal func() int64 + GetSequenceConfig func() SequenceConfig + Start func(ctx context.Context, option SequenceConfig) error + Stop func() error + type Executable interface + Execute func(ctx *Context) (result Result, warn uint16, err error) + type Executor interface + ConnectionClose func(ctx *Context) + ExecuteFieldList func(ctx *Context) ([]Field, error) + ExecuteUseDB func(ctx *Context, schema string) error + ExecutorComQuery func(ctx *Context, callback func(Result, uint16, error) error) error + ExecutorComStmtExecute func(ctx *Context) (Result, uint16, error) + InGlobalTransaction func(ctx *Context) bool + InLocalTransaction func(ctx *Context) bool + ProcessDistributedTransaction func() bool + type Field interface + DatabaseTypeName func() string + DecimalSize func() (precision, scale int64, ok bool) + Length func() (length int64, ok bool) + Name func() string + Nullable func() (nullable, ok bool) + ScanType func() reflect.Type + type FrontConn interface + CharacterSet func() uint8 + ID func() uint32 + Schema func() string + ServerVersion func() string + SetSchema func(schema string) + SetTenant func(tenant string) + SetTransientVariables func(v map[string]Value) + Tenant func() string + TransientVariables func() map[string]Value + type Func interface + Apply func(ctx context.Context, inputs ...Valuer) (Value, error) + NumInput func() int + func GetFunc(name string) (Func, bool) + func MustGetFunc(name string) Func + type FuncValuer func(ctx context.Context) (Value, error) + func (f FuncValuer) Value(ctx context.Context) (Value, error) + type IndexMetadata struct + Name string + type KeyedRow interface + Fields func() []Field + Get func(name string) (Value, error) + type Listener interface + Close func() + Listen func() + SetExecutor func(executor Executor) + type NodeConn struct + Database string + Host string + Parameters string + Password string + Port int + UserName string + Weight string + type Null struct + func (n Null) String() string + type Optimizer interface + Optimize func(ctx context.Context) (Plan, error) + type Plan interface + ExecIn func(ctx context.Context, conn VConn) (Result, error) + Type func() PlanType + type PlanType uint8 + const PlanTypeExec + const PlanTypeQuery + type Result interface + Dataset func() (Dataset, error) + LastInsertId func() (uint64, error) + RowsAffected func() (uint64, error) + type Row interface + IsBinary func() bool + Length func() int + Scan func(dest []Value) error + type RuntimeCtxKey = struct + type SchemaLoader interface + Load func(ctx context.Context, schema string, table []string) (map[string]*TableMetadata, error) + func LoadSchemaLoader() SchemaLoader + type Sequence interface + Acquire func(ctx context.Context) (int64, error) + Reset func() error + Update func() error + type SequenceConfig struct + Name string + Option map[string]string + Type string + type SequenceManager interface + CreateSequence func(ctx context.Context, tenant, schema string, opt SequenceConfig) (Sequence, error) + GetSequence func(ctx context.Context, tenant, schema, name string) (Sequence, error) + func LoadSequenceManager() SequenceManager + type SequenceSupplier func() EnhancedSequence + func GetSequenceSupplier(name string) (SequenceSupplier, bool) + type Stmt struct + BindVars map[string]Value + ColumnNames []string + Hints []*hint.Hint + ParamsCount uint16 + ParamsType []int32 + PrepareStmt string + StatementID uint32 + StmtNode ast.StmtNode + type TableMetadata struct + ColumnNames []string + Columns map[string]*ColumnMetadata + Indexes map[string]*IndexMetadata + Name string + PrimaryKeyColumns []string + func NewTableMetadata(name string, columnMetadataList []*ColumnMetadata, ...) *TableMetadata + type Tx interface + Commit func(ctx context.Context) (Result, uint16, error) + ID func() string + Rollback func(ctx context.Context) (Result, uint16, error) + type VConn interface + Exec func(ctx context.Context, db string, query string, args ...Value) (Result, error) + Query func(ctx context.Context, db string, query string, args ...Value) (Result, error) + type Value interface + Bool func() (bool, error) + Decimal func() (decimal.Decimal, error) + Family func() ValueFamily + Float64 func() (float64, error) + Int64 func() (int64, error) + Less func(than Value) bool + Time func() (time.Time, error) + Uint64 func() (uint64, error) + func MustNewValue(input interface{}) Value + func MustNewValueDecimalString(s string) Value + func NewValue(input interface{}) (Value, error) + func NewValueBool(b bool) Value + func NewValueDecimal(d decimal.Decimal) Value + func NewValueFloat64(v float64) Value + func NewValueInt64(v int64) Value + func NewValueString(s string) Value + func NewValueTime(t time.Time) Value + func NewValueTyped(origin Value, overwriteFamily ValueFamily) Value + func NewValueUint64(v uint64) Value + type ValueFamily uint8 + const ValueFamilyBool + const ValueFamilyDecimal + const ValueFamilyDuration + const ValueFamilyFloat + const ValueFamilySign + const ValueFamilyString + const ValueFamilyTime + const ValueFamilyUnsigned + func (v ValueFamily) IsNumberic() bool + func (v ValueFamily) String() string + type Valuer interface + Value func(ctx context.Context) (Value, error) + func ToValuer(value Value) Valuer + func ToValuerWithError(err error) Valuer + type VersionSupport interface + Version func(ctx context.Context) (string, error) + type VersionedFunc interface + Versions func() semver.Range + type Weight struct + R int32 + W int32 v0.1.0-rc1 Sep 1, 2022