Documentation
¶
Index ¶
- Constants
- func BeginTransaction(ctx fns.Context) (err errors.CodeError)
- func BeginTransactionWithOption(ctx fns.Context, param BeginTransactionParam) (err errors.CodeError)
- func CommitTransaction(ctx fns.Context) (err errors.CodeError)
- func RollbackTransaction(ctx fns.Context) (err errors.CodeError)
- func Service() fns.Service
- type BeginTransactionParam
- type Client
- type Cluster
- type Column
- type ColumnScanner
- type ColumnType
- type Config
- type ExecResult
- type Executor
- type FieldColumn
- type GlobalTransaction
- type GlobalTransactionManagement
- func (gtm *GlobalTransactionManagement) Begin(ctx fns.Context, db0 *db.DB, isolation db.IsolationLevel, ...) (err error)
- func (gtm *GlobalTransactionManagement) Close()
- func (gtm *GlobalTransactionManagement) Commit(ctx fns.Context) (err error)
- func (gtm *GlobalTransactionManagement) Get(ctx fns.Context) (tx *db.Tx, has bool)
- func (gtm *GlobalTransactionManagement) Rollback(ctx fns.Context)
- type KDB
- type MasterSlaver
- type NullJson
- type NullSQLRaw
- type Param
- type QueryAble
- type Row
- type Rows
- type Standalone
- type Tuple
- type TxAddress
Constants ¶
View Source
const ( StringType = ColumnType("string") IntType = ColumnType("int") FloatType = ColumnType("float") BytesType = ColumnType("bytes") JsonType = ColumnType("json") BoolType = ColumnType("bool") TimeType = ColumnType("time") UnknownType = ColumnType("unknown") )
Variables ¶
This section is empty.
Functions ¶
func BeginTransaction ¶ added in v0.8.1
func BeginTransactionWithOption ¶ added in v0.8.1
func BeginTransactionWithOption(ctx fns.Context, param BeginTransactionParam) (err errors.CodeError)
func CommitTransaction ¶ added in v0.8.1
func RollbackTransaction ¶ added in v0.8.1
Types ¶
type BeginTransactionParam ¶ added in v0.8.1
type BeginTransactionParam struct { Timeout time.Duration `json:"timeout,omitempty"` Isolation db.IsolationLevel `json:"isolation,omitempty"` }
func DefaultTransactionOption ¶ added in v0.8.1
func DefaultTransactionOption() (v BeginTransactionParam)
func TransactionOption ¶ added in v0.8.1
func TransactionOption(timeout string, isolation db.IsolationLevel) (v BeginTransactionParam)
type Column ¶
type Column struct { Type ColumnType `json:"type,omitempty"` Name string `json:"name,omitempty"` Value json.RawMessage `json:"value,omitempty"` Nil bool `json:"nil,omitempty"` }
type ColumnScanner ¶ added in v0.9.6
type ColumnScanner struct { Column // contains filtered or unexported fields }
func NewColumnScanner ¶ added in v0.9.6
func NewColumnScanner(ct *db.ColumnType) (scanner *ColumnScanner)
func (*ColumnScanner) Scan ¶ added in v0.9.6
func (c *ColumnScanner) Scan(src interface{}) error
type ColumnType ¶
type ColumnType string
type Config ¶
type Config struct { Driver string `json:"driver"` MasterSlaverMode bool `json:"masterSlaverMode,omitempty"` DSN []string `json:"dsn,omitempty"` MaxIdles int `json:"maxIdles,omitempty"` MaxOpens int `json:"maxOpens,omitempty"` EnableDebugLog bool `json:"enableDebugLog"` }
func (*Config) CreateClient ¶
type ExecResult ¶
type FieldColumn ¶ added in v0.3.10
type GlobalTransaction ¶
type GlobalTransaction struct {
// contains filtered or unexported fields
}
type GlobalTransactionManagement ¶
type GlobalTransactionManagement struct {
// contains filtered or unexported fields
}
func NewGlobalTransactionManagement ¶
func NewGlobalTransactionManagement() *GlobalTransactionManagement
func (*GlobalTransactionManagement) Begin ¶ added in v0.4.2
func (gtm *GlobalTransactionManagement) Begin(ctx fns.Context, db0 *db.DB, isolation db.IsolationLevel, timeout time.Duration) (err error)
func (*GlobalTransactionManagement) Close ¶
func (gtm *GlobalTransactionManagement) Close()
func (*GlobalTransactionManagement) Commit ¶ added in v0.4.2
func (gtm *GlobalTransactionManagement) Commit(ctx fns.Context) (err error)
func (*GlobalTransactionManagement) Rollback ¶ added in v0.4.2
func (gtm *GlobalTransactionManagement) Rollback(ctx fns.Context)
type MasterSlaver ¶
type MasterSlaver struct {
// contains filtered or unexported fields
}
func NewMasterSlaver ¶
func NewMasterSlaver(master *db.DB, slavers []*db.DB) (client *MasterSlaver)
func (*MasterSlaver) Close ¶
func (client *MasterSlaver) Close() (err error)
func (*MasterSlaver) Reader ¶
func (client *MasterSlaver) Reader() (v *db.DB)
func (*MasterSlaver) Writer ¶
func (client *MasterSlaver) Writer() (v *db.DB)
type NullJson ¶
type NullJson struct { Json json.RawMessage Valid bool }
type NullSQLRaw ¶
func (*NullSQLRaw) Scan ¶
func (v *NullSQLRaw) Scan(src interface{}) error
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
func (*Row) MarshalJSON ¶ added in v0.9.6
func (*Row) UnmarshalJSON ¶ added in v0.9.6
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) MarshalJSON ¶ added in v0.9.6
func (*Rows) UnmarshalJSON ¶ added in v0.9.6
type Standalone ¶
type Standalone struct {
// contains filtered or unexported fields
}
func NewStandalone ¶
func NewStandalone(v *db.DB) (client *Standalone)
func (*Standalone) Close ¶
func (client *Standalone) Close() (err error)
func (*Standalone) Reader ¶
func (client *Standalone) Reader() (v *db.DB)
func (*Standalone) Writer ¶
func (client *Standalone) Writer() (v *db.DB)
type Tuple ¶
type Tuple struct {
// contains filtered or unexported fields
}
func (Tuple) MarshalJSON ¶
func (*Tuple) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.