Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Abort(context.Context) error
- func (c *Client) Clone() dal.RDB
- func (c *Client) Close() error
- func (c *Client) Commit(context.Context) error
- func (c *Client) CreateTable(collName string) error
- func (c *Client) DropTable(collName string) error
- func (c *Client) HasTable(collName string) (bool, error)
- func (c *Client) IsDuplicatedError(err error) bool
- func (c *Client) IsNotFoundError(err error) bool
- func (c *Client) NextSequence(ctx context.Context, sequenceName string) (uint64, error)
- func (c *Client) Ping() error
- func (c *Client) StartTransaction(ctx context.Context) (dal.RDB, error)
- func (c *Client) Table(collName string) dal.Table
- func (c *Client) TxnInfo() *types.Transaction
- type Collection
- func (c *Collection) AddColumn(ctx context.Context, column string, value interface{}) error
- func (c *Collection) CreateIndex(ctx context.Context, index dal.Index) error
- func (c *Collection) Delete(ctx context.Context, filter dal.Filter) error
- func (c *Collection) DropColumn(ctx context.Context, field string) error
- func (c *Collection) DropIndex(ctx context.Context, indexName string) error
- func (c *Collection) Find(filter dal.Filter) dal.Find
- func (c *Collection) Indexes(ctx context.Context) ([]dal.Index, error)
- func (c *Collection) Insert(ctx context.Context, docs interface{}) error
- func (c *Collection) RenameColumn(ctx context.Context, oldName, newColumn string) error
- func (c *Collection) Update(ctx context.Context, filter dal.Filter, doc interface{}) error
- type Find
- func (f *Find) All(ctx context.Context, result interface{}) error
- func (f *Find) Count(ctx context.Context) (uint64, error)
- func (f *Find) Fields(fields ...string) dal.Find
- func (f *Find) Limit(limit uint64) dal.Find
- func (f *Find) One(ctx context.Context, result interface{}) error
- func (f *Find) Sort(sort string) dal.Find
- func (f *Find) Start(start uint64) dal.Find
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSessionMissing = errors.New("session missing")
ErrSessionMissing session missing
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implement client.DALRDB interface
func (*Client) IsDuplicatedError ¶
IsDuplicatedError interface compatibility
func (*Client) IsNotFoundError ¶
IsNotFoundError interface compatibility
func (*Client) NextSequence ¶
NextSequence 获取新序列号(非事务)
func (*Client) StartTransaction ¶
StartTransaction 开启新事务
type Collection ¶
type Collection struct { *Client // contains filtered or unexported fields }
Collection implement client.Collection interface
func (*Collection) AddColumn ¶
func (c *Collection) AddColumn(ctx context.Context, column string, value interface{}) error
AddColumn 添加字段
func (*Collection) CreateIndex ¶
CreateIndex 创建索引
func (*Collection) DropColumn ¶
func (c *Collection) DropColumn(ctx context.Context, field string) error
DropColumn 移除字段
func (*Collection) DropIndex ¶
func (c *Collection) DropIndex(ctx context.Context, indexName string) error
DropIndex 移除索引
func (*Collection) Find ¶
func (c *Collection) Find(filter dal.Filter) dal.Find
Find 查询多个并反序列化到 Result
func (*Collection) Insert ¶
func (c *Collection) Insert(ctx context.Context, docs interface{}) error
Insert 插入数据, docs 可以为 单个数据 或者 多个数据
func (*Collection) RenameColumn ¶
func (c *Collection) RenameColumn(ctx context.Context, oldName, newColumn string) error
RenameColumn 重命名字段
type Find ¶
type Find struct { *Collection // contains filtered or unexported fields }
Find define a find operation
Click to show internal directories.
Click to hide internal directories.