data

package
v0.0.36-beta.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 21 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 NewDataV3 added in v0.0.35

func NewDataV3(s *structs.AppCtx) data.IDataV3

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 DataV3 added in v0.0.35

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

func (*DataV3) NewTransaction added in v0.0.35

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

func (*DataV3) Object added in v0.0.35

func (d *DataV3) Object(objectAPIName string) data.IObjectV3

func (*DataV3) Oql added in v0.0.35

func (d *DataV3) 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{}) error, params ...structs.FindStreamParam) 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 ObjectV3 added in v0.0.35

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

func NewObjectV3 added in v0.0.35

func NewObjectV3(s *structs.AppCtx, objectAPIName string) *ObjectV3

func (*ObjectV3) BatchCreate added in v0.0.35

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

func (*ObjectV3) BatchDelete added in v0.0.35

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

func (*ObjectV3) BatchUpdate added in v0.0.35

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

func (*ObjectV3) Count added in v0.0.35

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

func (*ObjectV3) Create added in v0.0.35

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

func (*ObjectV3) Delete added in v0.0.35

func (o *ObjectV3) Delete(ctx context.Context, _id string) error

func (*ObjectV3) Find added in v0.0.35

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

func (*ObjectV3) FindAll added in v0.0.35

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

FindAll Deprecated

func (*ObjectV3) FindOne added in v0.0.35

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

func (*ObjectV3) FindStream added in v0.0.35

func (o *ObjectV3) FindStream(ctx context.Context, recordType reflect.Type, handler func(ctx context.Context, records interface{}) error, params ...structs.FindStreamParam) error

func (*ObjectV3) FuzzySearch added in v0.0.35

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

func (*ObjectV3) Limit added in v0.0.35

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

func (*ObjectV3) Offset added in v0.0.35

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

func (*ObjectV3) OrderBy added in v0.0.35

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

func (*ObjectV3) OrderByDesc added in v0.0.35

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

func (*ObjectV3) Select added in v0.0.35

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

func (*ObjectV3) Update added in v0.0.35

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

func (*ObjectV3) UseSystemAuth added in v0.0.35

func (o *ObjectV3) UseSystemAuth() data.IObjectV3

func (*ObjectV3) UseUserAuth added in v0.0.35

func (o *ObjectV3) UseUserAuth() data.IObjectV3

func (*ObjectV3) Where added in v0.0.35

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

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{}) error, params ...structs.FindStreamParam) 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