data

package
v0.0.21-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndGetSlice added in v0.0.14

func CheckAndGetSlice(recordType reflect.Type) (reflect.Value, error)

func NewData

func NewData(s *structs.AppCtx) data.IData

func NewDataV2

func NewDataV2(s *structs.AppCtx) data.IDataV2

func NewOql

func NewOql(s *structs.AppCtx, oql string, args ...interface{}) data.IOql

func NewTransaction

func NewTransaction(s *structs.AppCtx) data.ITransaction

func NewTransactionObject

func NewTransactionObject(t *Transaction, objectAPIName string) data.ITransactionObject

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

func (*Data) NewTransaction

func (d *Data) NewTransaction() data.ITransaction

func (*Data) Object

func (d *Data) Object(objectAPIName string) data.IObject

func (*Data) Oql

func (d *Data) Oql(oql string, args ...interface{}) data.IOql

type DataV2

type DataV2 struct {
	// contains filtered or unexported fields
}

func (*DataV2) NewTransaction

func (d *DataV2) NewTransaction() data.ITransaction

func (*DataV2) Object

func (d *DataV2) Object(objectAPIName string) data.IObjectV2

func (*DataV2) Oql

func (d *DataV2) Oql(oql string, args ...interface{}) data.IOql

type FieldInfo

type FieldInfo struct {
	APIName string `json:"api_name"`
	Type    struct {
		Settings struct {
			LookupObjectAPIName string `json:"referenced_object_api_name"`
		} `json:"settings"`
	} `json:"type"`
}

type Object

type Object struct {
	// contains filtered or unexported fields
}

func NewObject

func NewObject(s *structs.AppCtx, objectAPIName string) *Object

func (*Object) BatchCreate

func (o *Object) BatchCreate(ctx context.Context, records interface{}) ([]int64, error)

func (*Object) BatchCreateAsync

func (o *Object) BatchCreateAsync(ctx context.Context, records interface{}) (int64, error)

func (*Object) BatchDelete

func (o *Object) BatchDelete(ctx context.Context, _ids []int64, result ...interface{}) error

func (*Object) BatchDeleteAsync

func (o *Object) BatchDeleteAsync(ctx context.Context, _ids []int64) (int64, error)

func (*Object) BatchUpdate

func (o *Object) BatchUpdate(ctx context.Context, records map[int64]interface{}, result ...interface{}) error

func (*Object) BatchUpdateAsync

func (o *Object) BatchUpdateAsync(ctx context.Context, records map[int64]interface{}) (int64, error)

func (*Object) Count

func (o *Object) Count(ctx context.Context) (int64, error)

func (*Object) Create

func (o *Object) Create(ctx context.Context, record interface{}) (*structs.RecordID, error)

func (*Object) Delete

func (o *Object) Delete(ctx context.Context, _id int64) error

func (*Object) Find

func (o *Object) Find(ctx context.Context, records interface{}, unauthFields ...interface{}) error

func (*Object) FindAll

func (o *Object) FindAll(ctx context.Context, records interface{}) error

FindAll Deprecated

func (*Object) FindOne

func (o *Object) FindOne(ctx context.Context, record interface{}, unauthFields ...interface{}) error

func (*Object) FindStream added in v0.0.14

func (o *Object) FindStream(ctx context.Context, recordType reflect.Type, handler func(ctx context.Context, records interface{}, unauthFields interface{}) error) error

func (*Object) FuzzySearch added in v0.0.16

func (o *Object) FuzzySearch(keyword string, fieldAPINames []string) data.IQuery

func (*Object) Limit

func (o *Object) Limit(limit int64) data.IQuery

func (*Object) Offset

func (o *Object) Offset(offset int64) data.IQuery

func (*Object) OrderBy

func (o *Object) OrderBy(fieldAPINames ...string) data.IQuery

func (*Object) OrderByDesc

func (o *Object) OrderByDesc(fieldAPINames ...string) data.IQuery

func (*Object) Select

func (o *Object) Select(fieldAPINames ...string) data.IQuery

func (*Object) Update

func (o *Object) Update(ctx context.Context, _id int64, record interface{}) error

func (*Object) UseSystemAuth added in v0.0.15

func (o *Object) UseSystemAuth() data.IObject

func (*Object) UseUserAuth added in v0.0.15

func (o *Object) UseUserAuth() data.IObject

func (*Object) Where

func (o *Object) Where(condition interface{}) data.IQuery

type ObjectInfo

type ObjectInfo struct {
	Fields []*FieldInfo `json:"fields"`
}

type Oql

type Oql struct {
	// contains filtered or unexported fields
}

func (*Oql) Execute

func (o *Oql) Execute(ctx context.Context, resultSet interface{}, unauthFields ...interface{}) error

func (*Oql) UseSystemAuth added in v0.0.15

func (o *Oql) UseSystemAuth() data.IOql

func (*Oql) UseUserAuth added in v0.0.15

func (o *Oql) UseUserAuth() data.IOql

type Query

type Query struct {
	// contains filtered or unexported fields
}

func (*Query) Count

func (q *Query) Count(ctx context.Context) (int64, error)

func (*Query) Find

func (q *Query) Find(ctx context.Context, records interface{}, unauthFields ...interface{}) (err error)

func (*Query) FindAll

func (q *Query) FindAll(ctx context.Context, records interface{}) error

func (*Query) FindOne

func (q *Query) FindOne(ctx context.Context, record interface{}, unauthFields ...interface{}) (err error)

func (*Query) FindStream added in v0.0.14

func (q *Query) FindStream(ctx context.Context, recordType reflect.Type, handler func(ctx context.Context, records interface{}, unauthFields interface{}) error) error

func (*Query) FuzzySearch added in v0.0.16

func (q *Query) FuzzySearch(keyword string, fieldAPINames []string) data.IQuery

func (*Query) Limit

func (q *Query) Limit(limit int64) data.IQuery

func (*Query) Offset

func (q *Query) Offset(offset int64) data.IQuery

func (*Query) OrderBy

func (q *Query) OrderBy(fieldAPINames ...string) data.IQuery

func (*Query) OrderByDesc

func (q *Query) OrderByDesc(fieldAPINames ...string) data.IQuery

func (*Query) Select

func (q *Query) Select(fieldAPINames ...string) data.IQuery

func (*Query) UseSystemAuth added in v0.0.15

func (q *Query) UseSystemAuth() data.IQuery

func (*Query) UseUserAuth added in v0.0.15

func (q *Query) UseUserAuth() data.IQuery

func (*Query) Where

func (q *Query) Where(condition interface{}) data.IQuery

Where 配置过滤条件 @param condition:过滤条件,其类型为 *cond.LogicalExpression 或 *cond.ArithmeticExpression,不合法的类型会报错 @example condition:

cond.And(...)
cond.Or(...)
cond.Eq(...)
cond.Gt(...)

@return 返回查询对象

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

func (*Transaction) Commit

func (t *Transaction) Commit(ctx context.Context) error

func (*Transaction) Object

func (t *Transaction) Object(objectAPIName string) data.ITransactionObject

func (*Transaction) UseSystemAuth added in v0.0.15

func (t *Transaction) UseSystemAuth() data.ITransaction

func (*Transaction) UseUserAuth added in v0.0.15

func (t *Transaction) UseUserAuth() data.ITransaction

type TransactionObject

type TransactionObject struct {
	// contains filtered or unexported fields
}

func (*TransactionObject) RegisterBatchCreate

func (t *TransactionObject) RegisterBatchCreate(records interface{}) ([]interface{}, error)

func (*TransactionObject) RegisterBatchDelete

func (t *TransactionObject) RegisterBatchDelete(_ids interface{})

func (*TransactionObject) RegisterBatchUpdate

func (t *TransactionObject) RegisterBatchUpdate(records interface{})

func (*TransactionObject) RegisterCreate

func (t *TransactionObject) RegisterCreate(record interface{}) (*structs.TransactionRecordID, error)

func (*TransactionObject) RegisterDelete

func (t *TransactionObject) RegisterDelete(_id interface{})

func (*TransactionObject) RegisterUpdate

func (t *TransactionObject) RegisterUpdate(_id interface{}, record interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL