Documentation
¶
Index ¶
- Constants
- func IsCompressed(flags int64) bool
- func IsDictCompressed(flags int64) bool
- type DecodeOptions
- type Dict
- type DictCollection
- func (c *DictCollection) DeleteAllVersions(key string) (err error)
- func (c *DictCollection) DeleteDict(key string, ver int64) (err error)
- func (c *DictCollection) Get(key string, ver uint8) (ok bool, dict Dict, err error)
- func (c *DictCollection) GetLatest(key string) (ok bool, d Dict, err error)
- func (c *DictCollection) GetMaxVersion(key string) (maxVer uint8, err error)
- func (c *DictCollection) Insert(key string, d Dict) (err error)
- type DictStore
- type EncodeOptions
- type Encoder
- func (e *Encoder) Decode(src []byte, destObj any, flags int64, opts DecodeOptions) (err error)
- func (e *Encoder) DecodeBuf(src []byte, flags int64, opts DecodeOptions) (buf []byte, err error)
- func (e *Encoder) DictCollection() *DictCollection
- func (e *Encoder) Encode(obj any, opts EncodeOptions) (flags int64, ebuf []byte, err error)
- func (e *Encoder) TrainWithRows(db *sql.DB, key string, selectSql string) (d Dict, err error)
- type KeyVal
- func (kv *KeyVal[T]) Delete(pkey any) (affectedCount int64, err error)
- func (kv *KeyVal[T]) Get(pkey any, obj *T) (ok bool, err error)
- func (kv *KeyVal[T]) GetUnique(columnName string, pkey any, obj *T) (ok bool, err error)
- func (kv *KeyVal[T]) Insert(obj *T) (rid int64, err error)
- func (kv *KeyVal[T]) Select(bindargs []any, opts SelectOptions[T]) (list []*T, err error)
- func (kv *KeyVal[T]) SoftDelete(pkey any) (affectedCount int64, err error)
- func (kv *KeyVal[T]) Table() *Table
- func (kv *KeyVal[T]) Train(limit int) (err error)
- func (kv *KeyVal[T]) Upsert(obj *T) (err error)
- type KeyValField
- type KeyValOptions
- type SelectOptions
- type StmtStore
- type Table
- func (t *Table) Insert(args ...any) (rid int64, err error)
- func (t *Table) Row(stmtName string, getSql func() string, bindargs []any, args ...any) (ok bool, err error)
- func (t *Table) Select(selectSql string, bindargs []any, handleRow func(row *sql.Rows) error) (err error)
- func (t *Table) SelectUsingStmt(stmtName string, getSql func() string, bindargs []any, ...) (err error)
- func (t Table) StmtStore() *StmtStore
- func (t *Table) Update(updateSql string, args ...any) (affectedCount int64, err error)
- func (t *Table) Upsert(args ...any) (rid int64, err error)
- type TableField
- type TableOptions
- type ZstdDict
Constants ¶
View Source
const ( EncodeSoftDelete = 0x1 EncodeFlagCompress = 0x2 EncodeFlagUseDict = 0x4 DictIDMask = 0xff00 )
Variables ¶
This section is empty.
Functions ¶
func IsCompressed ¶ added in v0.7.0
func IsDictCompressed ¶ added in v0.7.0
Types ¶
type DecodeOptions ¶ added in v0.7.0
type DecodeOptions struct {
DictKey string
}
type DictCollection ¶ added in v0.7.0
type DictCollection struct {
// contains filtered or unexported fields
}
func NewDictCollection ¶ added in v0.7.0
func NewDictCollection(db *sql.DB) (c *DictCollection, err error)
func (*DictCollection) DeleteAllVersions ¶ added in v0.7.0
func (c *DictCollection) DeleteAllVersions(key string) (err error)
func (*DictCollection) DeleteDict ¶ added in v0.7.0
func (c *DictCollection) DeleteDict(key string, ver int64) (err error)
func (*DictCollection) GetLatest ¶ added in v0.7.0
func (c *DictCollection) GetLatest(key string) (ok bool, d Dict, err error)
func (*DictCollection) GetMaxVersion ¶ added in v0.7.0
func (c *DictCollection) GetMaxVersion(key string) (maxVer uint8, err error)
type DictStore ¶ added in v0.7.0
type DictStore struct {
// contains filtered or unexported fields
}
type EncodeOptions ¶ added in v0.7.0
type Encoder ¶ added in v0.7.0
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶ added in v0.7.0
func NewEncoder(dictColl *DictCollection) (e *Encoder)
func (*Encoder) DictCollection ¶ added in v0.7.0
func (e *Encoder) DictCollection() *DictCollection
type KeyVal ¶ added in v0.7.0
type KeyVal[T any] struct { // contains filtered or unexported fields }
func (*KeyVal[T]) Select ¶ added in v0.7.0
func (kv *KeyVal[T]) Select(bindargs []any, opts SelectOptions[T]) (list []*T, err error)
func (*KeyVal[T]) SoftDelete ¶ added in v0.7.0
type KeyValField ¶ added in v0.7.0
type KeyValOptions ¶ added in v0.7.0
type KeyValOptions[T any] struct { KeyField *KeyValField[T] Fields []*KeyValField[T] Enc *Encoder OnInsert func(*T) OnUpdate func(*T) Validate func(*T) error Compression bool UseDict bool }
type SelectOptions ¶
type StmtStore ¶ added in v0.7.0
type StmtStore struct {
// contains filtered or unexported fields
}
func NewStmtStore ¶ added in v0.7.0
func NewStmtStore() *StmtStore
type Table ¶ added in v0.7.0
type Table struct {
Name string
// contains filtered or unexported fields
}
func (*Table) SelectUsingStmt ¶ added in v0.7.0
type TableField ¶ added in v0.7.0
type TableOptions ¶ added in v0.7.0
type TableOptions struct {
Fields []TableField
}
Click to show internal directories.
Click to hide internal directories.