processors

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XSAC_BE_INSERT = "beinsert"
	XSAC_BE_UPDATE = "beupdate"
	XSAC_BE_DELETE = "bedelete"

	XSAC_AF_INSERT = "afinsert"
	XSAC_AF_UPDATE = "afupdate"
	XSAC_AF_DELETE = "afdelete"
)
View Source
const (
	RELATION_AND = "AND"
	RELATION_OR  = "OR"

	SYMBOL_EQ   = "EQ"
	SYMBOL_NEQ  = "NEQ"
	SYMBOL_GT   = "GT"
	SYMBOL_LT   = "LT"
	SYMBOL_EQGT = "EQGT"
	SYMBOL_EQLT = "EQLT"
	SYMBOL_LIKE = "LIKE"

	ORDER_BY_ASC  = "ASC"
	ORDER_BY_DESC = "DESC"
)
View Source
const DISTINCT_MYSQL_QUERY_COUNT_SQL_TEMPLATE = `
	SELECT 
		count(distinct {{distinctID}}) AS QUERY_COUNT
	FROM 
		{{filterTableName}} 
	{{conditions}}
`
View Source
const DISTINCT_MYSQL_QUERY_SQL_TEMPLATE = `` /* 207-byte string literal not displayed */
View Source
const DISTINCT_POSTGRES_QUERY_COUNT_SQL_TEMPLATE = `
	SELECT 
		count(distinct {{distinctID}}) AS QUERY_COUNT
	FROM 
		{{filterTableName}} 
	{{conditions}}
`
View Source
const DISTINCT_POSTGRES_QUERY_SQL_TEMPLATE = `` /* 207-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type ZeroCondition

type ZeroCondition struct {
	Symbol   string           `json:"symbol,omitempty"`
	Column   string           `json:"column,omitempty"`
	Value    string           `json:"value,omitempty"`
	Relation []*ZeroCondition `json:"relation,omitempty"`
}

type ZeroCoreProcessor

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

func (*ZeroCoreProcessor) Build

func (processor *ZeroCoreProcessor) Build(transaction *sql.Tx)

func (*ZeroCoreProcessor) DatabaseDatetime

func (processor *ZeroCoreProcessor) DatabaseDatetime() (*time.Time, error)

func (*ZeroCoreProcessor) Exec added in v1.11.44

func (processor *ZeroCoreProcessor) Exec(execsql string) (sql.Result, error)

func (*ZeroCoreProcessor) Parser added in v1.1.0

func (processor *ZeroCoreProcessor) Parser(rows *sql.Rows) []map[string]interface{}

func (*ZeroCoreProcessor) PreparedStmt added in v1.1.0

func (processor *ZeroCoreProcessor) PreparedStmt(preparedSQL string) *sql.Stmt

type ZeroLimit

type ZeroLimit struct {
	Start  int `json:"start,omitempty"`
	Length int `json:"length,omitempty"`
}

type ZeroMysqlQueryOperation added in v1.11.23

type ZeroMysqlQueryOperation struct {
	ZeroCoreProcessor

	Start  int
	Length int
	// contains filtered or unexported fields
}

func NewZeroMysqlQueryOperation added in v1.11.23

func NewZeroMysqlQueryOperation(xQuery *ZeroQuery, xTableName string) *ZeroMysqlQueryOperation

func (*ZeroMysqlQueryOperation) AddDistinctID added in v1.11.23

func (opera *ZeroMysqlQueryOperation) AddDistinctID(distinctID string)

func (*ZeroMysqlQueryOperation) AddFilterTableName added in v1.11.23

func (opera *ZeroMysqlQueryOperation) AddFilterTableName(filterTableName string)

func (*ZeroMysqlQueryOperation) AddQuery added in v1.11.23

func (opera *ZeroMysqlQueryOperation) AddQuery(xQuery *ZeroQuery)

func (*ZeroMysqlQueryOperation) AddTableName added in v1.11.23

func (opera *ZeroMysqlQueryOperation) AddTableName(tableName string)

func (*ZeroMysqlQueryOperation) AppendCondition added in v1.11.23

func (opera *ZeroMysqlQueryOperation) AppendCondition(condition string)

func (*ZeroMysqlQueryOperation) Build added in v1.11.23

func (opera *ZeroMysqlQueryOperation) Build(transaction *sql.Tx)

func (*ZeroMysqlQueryOperation) Exec added in v1.11.23

func (opera *ZeroMysqlQueryOperation) Exec() ([]map[string]interface{}, map[string]interface{})

type ZeroOrderBy

type ZeroOrderBy struct {
	Column string `json:"column,omitempty"`
	Seq    string `json:"seq,omitempty"`
}

type ZeroPostgresQueryOperation added in v1.11.23

type ZeroPostgresQueryOperation struct {
	ZeroCoreProcessor

	Start  int
	Length int
	// contains filtered or unexported fields
}

func NewZeroPostgresQueryOperation added in v1.11.23

func NewZeroPostgresQueryOperation(xQuery *ZeroQuery, xTableName string) *ZeroPostgresQueryOperation

func (*ZeroPostgresQueryOperation) AddDistinctID added in v1.11.23

func (opera *ZeroPostgresQueryOperation) AddDistinctID(distinctID string)

func (*ZeroPostgresQueryOperation) AddFilterTableName added in v1.11.23

func (opera *ZeroPostgresQueryOperation) AddFilterTableName(filterTableName string)

func (*ZeroPostgresQueryOperation) AddQuery added in v1.11.23

func (opera *ZeroPostgresQueryOperation) AddQuery(xQuery *ZeroQuery)

func (*ZeroPostgresQueryOperation) AddTableName added in v1.11.23

func (opera *ZeroPostgresQueryOperation) AddTableName(tableName string)

func (*ZeroPostgresQueryOperation) AppendCondition added in v1.11.23

func (opera *ZeroPostgresQueryOperation) AppendCondition(condition string)

func (*ZeroPostgresQueryOperation) Build added in v1.11.23

func (opera *ZeroPostgresQueryOperation) Build(transaction *sql.Tx)

func (*ZeroPostgresQueryOperation) Exec added in v1.11.23

func (opera *ZeroPostgresQueryOperation) Exec() ([]map[string]interface{}, map[string]interface{})

type ZeroQuery

type ZeroQuery struct {
	Columns   []string       `json:"columns,omitempty"`
	Condition *ZeroCondition `json:"condition,omitempty"`
	Orderby   []*ZeroOrderBy `json:"orderby,omitempty"`
	Limit     *ZeroLimit     `json:"limit,omitempty"`
}

type ZeroQueryOperation

type ZeroQueryOperation interface {
	Build(transaction *sql.Tx)

	AddQuery(xQuery *ZeroQuery)
	AddTableName(tableName string)
	AddDistinctID(distinctID string)
	AddFilterTableName(filterTableName string)
	AppendCondition(condition string)

	Exec() ([]map[string]interface{}, map[string]interface{})
}

type ZeroXsacAutoProcessor added in v1.11.0

type ZeroXsacAutoProcessor interface {
	Build(transaction *sql.Tx)

	AddFields(fields []*structs.ZeroXsacField)
	AddTriggers(...structs.ZeroXsacTrigger)

	Insert(...interface{}) error
	Update(...interface{}) error
	Delete(...interface{}) error
	Tombstone(...interface{}) error
	Xrestore(...interface{}) error
	Fetch(string) (interface{}, error)
	FetchChildrens(*structs.ZeroXsacField, interface{}) error
}

type ZeroXsacMysqlAutoProcessor added in v1.11.42

type ZeroXsacMysqlAutoProcessor struct {
	ZeroCoreProcessor
	// contains filtered or unexported fields
}

func NewXsacMysqlProcessor added in v1.11.42

func NewXsacMysqlProcessor(triggers ...structs.ZeroXsacTrigger) *ZeroXsacMysqlAutoProcessor

func (*ZeroXsacMysqlAutoProcessor) AddFields added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) AddFields(fields []*structs.ZeroXsacField)

func (*ZeroXsacMysqlAutoProcessor) AddTriggers added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) AddTriggers(triggers ...structs.ZeroXsacTrigger)

func (*ZeroXsacMysqlAutoProcessor) Delete added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) Delete(datas ...interface{}) error

func (*ZeroXsacMysqlAutoProcessor) Fetch added in v1.11.65

func (processor *ZeroXsacMysqlAutoProcessor) Fetch(dataId string) (interface{}, error)

func (*ZeroXsacMysqlAutoProcessor) FetchChildrens added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) FetchChildrens(field *structs.ZeroXsacField, datas interface{}) error

func (*ZeroXsacMysqlAutoProcessor) Insert added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) Insert(datas ...interface{}) error

func (*ZeroXsacMysqlAutoProcessor) Tombstone added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) Tombstone(datas ...interface{}) error

func (*ZeroXsacMysqlAutoProcessor) Update added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) Update(datas ...interface{}) error

func (*ZeroXsacMysqlAutoProcessor) Xrestore added in v1.11.42

func (processor *ZeroXsacMysqlAutoProcessor) Xrestore(datas ...interface{}) error

type ZeroXsacPostgresAutoProcessor added in v1.11.0

type ZeroXsacPostgresAutoProcessor struct {
	ZeroCoreProcessor
	// contains filtered or unexported fields
}

func NewXsacPostgresProcessor added in v1.11.0

func NewXsacPostgresProcessor(triggers ...structs.ZeroXsacTrigger) *ZeroXsacPostgresAutoProcessor

func (*ZeroXsacPostgresAutoProcessor) AddFields added in v1.11.10

func (processor *ZeroXsacPostgresAutoProcessor) AddFields(fields []*structs.ZeroXsacField)

func (*ZeroXsacPostgresAutoProcessor) AddTriggers added in v1.11.0

func (processor *ZeroXsacPostgresAutoProcessor) AddTriggers(triggers ...structs.ZeroXsacTrigger)

func (*ZeroXsacPostgresAutoProcessor) Delete added in v1.11.0

func (processor *ZeroXsacPostgresAutoProcessor) Delete(datas ...interface{}) error

func (*ZeroXsacPostgresAutoProcessor) Fetch added in v1.11.65

func (processor *ZeroXsacPostgresAutoProcessor) Fetch(dataId string) (interface{}, error)

func (*ZeroXsacPostgresAutoProcessor) FetchChildrens added in v1.11.29

func (processor *ZeroXsacPostgresAutoProcessor) FetchChildrens(field *structs.ZeroXsacField, datas interface{}) error

func (*ZeroXsacPostgresAutoProcessor) Insert added in v1.11.0

func (processor *ZeroXsacPostgresAutoProcessor) Insert(datas ...interface{}) error

func (*ZeroXsacPostgresAutoProcessor) Tombstone added in v1.11.34

func (processor *ZeroXsacPostgresAutoProcessor) Tombstone(datas ...interface{}) error

func (*ZeroXsacPostgresAutoProcessor) Update added in v1.11.0

func (processor *ZeroXsacPostgresAutoProcessor) Update(datas ...interface{}) error

func (*ZeroXsacPostgresAutoProcessor) Xrestore added in v1.11.34

func (processor *ZeroXsacPostgresAutoProcessor) Xrestore(datas ...interface{}) error

Jump to

Keyboard shortcuts

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