Documentation
¶
Index ¶
- Constants
- Variables
- func Compress(src []byte) []byte
- func GenerateID64() int64
- type Collection
- func (c *Collection) Delete(ctx context.Context, id int64) (err error)
- func (c *Collection) Get(ctx context.Context, obj CollectionType) (ok bool, err error)
- func (c *Collection) GetUnique(ctx context.Context, colname string, colval any, obj CollectionType) (ok bool, err error)
- func (c *Collection) Insert(ctx context.Context, val CollectionType) (changeCount int, err error)
- func (c *Collection) List(ctx context.Context, keyPrefix string, fn GetFn, opts ListOptions) (err error)
- func (c *Collection) Put(ctx context.Context, val CollectionType) (changeCount int, err error)
- func (c *Collection) Search(ctx context.Context, query string, rowfn RowFn) (err error)
- func (c *Collection) Select(ctx context.Context, rowFn RowFn, opts SelectOptions) (err error)
- func (c *Collection) Update(ctx context.Context, obj CollectionType) (changeCount int, err error)
- type CollectionOptions
- type CollectionType
- type Counter
- func (c *Counter) Column(i int, name string) (ok bool, val any, err error)
- func (c *Counter) GetId() int64
- func (c *Counter) GetVal() (val []byte, err error)
- func (c *Counter) Next(ctx context.Context) (counter int64, err error)
- func (c *Counter) SetColumn(i int, name string, ok bool, val any) error
- func (c *Counter) SetId(id int64)
- func (c *Counter) SetVal(val []byte) error
- type CounterOptions
- type DerivedColumn
- type FTSOptions
- type GetFn
- type KV
- type ListOptions
- type Options
- type ParseFn
- type RowFn
- type SelectOptions
Constants ¶
View Source
const ( SQLITE_CONSTRAINT_UNIQUE = 2067 SQLITE_CONSTRAINT_PRIMARYKEY = 1555 )
Variables ¶
Functions ¶
func Compress ¶ added in v0.5.0
Compress a buffer. If you have a destination buffer, the allocation in the call can also be eliminated.
func GenerateID64 ¶ added in v0.3.0
func GenerateID64() int64
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func NewCollection ¶ added in v0.3.0
func NewCollection(kv *KV, name string, opts *CollectionOptions) (col *Collection, err error)
func (*Collection) Delete ¶ added in v0.5.0
func (c *Collection) Delete(ctx context.Context, id int64) (err error)
func (*Collection) Get ¶
func (c *Collection) Get(ctx context.Context, obj CollectionType) (ok bool, err error)
func (*Collection) GetUnique ¶ added in v0.3.0
func (c *Collection) GetUnique(ctx context.Context, colname string, colval any, obj CollectionType) (ok bool, err error)
func (*Collection) Insert ¶ added in v0.3.0
func (c *Collection) Insert(ctx context.Context, val CollectionType) (changeCount int, err error)
func (*Collection) List ¶
func (c *Collection) List(ctx context.Context, keyPrefix string, fn GetFn, opts ListOptions) (err error)
func (*Collection) Put ¶
func (c *Collection) Put(ctx context.Context, val CollectionType) (changeCount int, err error)
func (*Collection) Select ¶
func (c *Collection) Select(ctx context.Context, rowFn RowFn, opts SelectOptions) (err error)
func (*Collection) Update ¶ added in v0.3.0
func (c *Collection) Update(ctx context.Context, obj CollectionType) (changeCount int, err error)
type CollectionOptions ¶
type CollectionOptions struct {
Columns []DerivedColumn
Indexes []string
AutoId bool
Json bool
FTS *FTSOptions
Compress bool
}
type CollectionType ¶ added in v0.3.0
type Counter ¶
type Counter struct {
Id int64
Start int64 `json:"start"`
ReserveCount int64 `json:"reserve_count"`
Current int64 `json:"current"`
Limit int64 `json:"limit"`
// contains filtered or unexported fields
}
func NewCounter ¶
func NewCounter(col *Collection, opts CounterOptions) (c *Counter, err error)
type CounterOptions ¶
type DerivedColumn ¶ added in v0.3.0
type FTSOptions ¶ added in v0.3.0
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
func (*KV) WalCheckpoint ¶ added in v0.5.0
type ListOptions ¶
type ParseFn ¶ added in v0.3.0
type ParseFn func(obj CollectionType) error
type RowFn ¶
func GetAccumulateFn ¶ added in v0.3.0
type SelectOptions ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.