Documentation ¶
Index ¶
- func AddCopyStatement(conflict, from, to []handler.Column, conditions []handler.Condition, ...) func(eventstore.Event) Exec
- func AddCreateStatement(columns []handler.Column, opts ...execOption) func(eventstore.Event) Exec
- func AddDeleteStatement(conditions []handler.Condition, opts ...execOption) func(eventstore.Event) Exec
- func AddUpdateStatement(values []handler.Column, conditions []handler.Condition, opts ...execOption) func(eventstore.Event) Exec
- func AddUpsertStatement(indexCols []handler.Column, values []handler.Column, opts ...execOption) func(eventstore.Event) Exec
- func Hash(bucketsCount uint16) indexOpts
- func NewArrayAppendCol(column string, value interface{}) handler.Column
- func NewArrayIntersectCol(column string, value interface{}) handler.Column
- func NewArrayRemoveCol(column string, value interface{}) handler.Column
- func NewCopyCol(column, from string) handler.Column
- func NewCopyStatement(event eventstore.Event, conflictCols, from, to []handler.Column, ...) *handler.Statement
- func NewCreateStatement(event eventstore.Event, values []handler.Column, opts ...execOption) *handler.Statement
- func NewDeleteStatement(event eventstore.Event, conditions []handler.Condition, opts ...execOption) *handler.Statement
- func NewMultiStatement(event eventstore.Event, opts ...func(eventstore.Event) Exec) *handler.Statement
- func NewMultiTableCheck(primaryTable *Table, secondaryTables ...*SuffixedTable) *handler.Check
- func NewNoOpStatement(event eventstore.Event) *handler.Statement
- func NewTableCheck(table *Table, opts ...execOption) *handler.Check
- func NewUpdateStatement(event eventstore.Event, values []handler.Column, ...) *handler.Statement
- func NewUpsertStatement(event eventstore.Event, conflictCols []handler.Column, values []handler.Column, ...) *handler.Statement
- func NewViewCheck(selectStmt string, secondaryTables ...*SuffixedTable) *handler.Check
- func WithTableSuffix(name string) func(*execConfig)
- type Column
- type ColumnOption
- type ColumnType
- type Constraint
- type Exec
- type ForeignKey
- type Index
- type Locker
- type PrimaryKey
- type StatementHandler
- func (h *StatementHandler) Init(ctx context.Context, initialized chan<- bool, checks ...*handler.Check) error
- func (h *StatementHandler) SearchQuery(ctx context.Context, instanceIDs []string) (*eventstore.SearchQueryBuilder, uint64, error)
- func (h *StatementHandler) Update(ctx context.Context, stmts []*handler.Statement, reduce handler.Reduce) (index int, err error)
- type StatementHandlerConfig
- type SuffixedTable
- type Table
- type TableOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCopyStatement ¶
func AddCreateStatement ¶
func AddCreateStatement(columns []handler.Column, opts ...execOption) func(eventstore.Event) Exec
func AddDeleteStatement ¶
func AddDeleteStatement(conditions []handler.Condition, opts ...execOption) func(eventstore.Event) Exec
func AddUpdateStatement ¶
func AddUpsertStatement ¶
func NewArrayAppendCol ¶
func NewArrayIntersectCol ¶
func NewArrayRemoveCol ¶
func NewCopyCol ¶
func NewCopyStatement ¶
func NewCopyStatement(event eventstore.Event, conflictCols, from, to []handler.Column, conds []handler.Condition, opts ...execOption) *handler.Statement
NewCopyStatement creates a new upsert statement which updates a column from an existing row cols represent the columns which are objective to change. if the value of a col is empty the data will be copied from the selected row if the value of a col is not empty the data will be set by the static value conds represent the conditions for the selection subquery
func NewCreateStatement ¶
func NewDeleteStatement ¶
func NewMultiStatement ¶
func NewMultiStatement(event eventstore.Event, opts ...func(eventstore.Event) Exec) *handler.Statement
func NewMultiTableCheck ¶
func NewMultiTableCheck(primaryTable *Table, secondaryTables ...*SuffixedTable) *handler.Check
func NewNoOpStatement ¶
func NewNoOpStatement(event eventstore.Event) *handler.Statement
func NewTableCheck ¶
func NewUpdateStatement ¶
func NewUpsertStatement ¶
func NewViewCheck ¶
func NewViewCheck(selectStmt string, secondaryTables ...*SuffixedTable) *handler.Check
func WithTableSuffix ¶
func WithTableSuffix(name string) func(*execConfig)
Types ¶
type Column ¶
type Column struct { Name string Type ColumnType // contains filtered or unexported fields }
func NewColumn ¶
func NewColumn(name string, columnType ColumnType, opts ...ColumnOption) *Column
type ColumnOption ¶
type ColumnOption func(*Column)
func Default ¶
func Default(value interface{}) ColumnOption
func DeleteCascade ¶
func DeleteCascade(column string) ColumnOption
func Nullable ¶
func Nullable() ColumnOption
type ColumnType ¶
type ColumnType int32
const ( ColumnTypeText ColumnType = iota ColumnTypeTextArray ColumnTypeJSONB ColumnTypeBytes ColumnTypeTimestamp ColumnTypeEnum ColumnTypeEnumArray ColumnTypeInt64 ColumnTypeBool )
type Constraint ¶
func NewConstraint ¶
func NewConstraint(name string, columns []string) *Constraint
type ForeignKey ¶
func NewForeignKey ¶
func NewForeignKey(name string, columns []string, refColumns []string) *ForeignKey
func NewForeignKeyOfPublicKeys ¶
func NewForeignKeyOfPublicKeys(name string) *ForeignKey
type Locker ¶
type PrimaryKey ¶
type PrimaryKey []string
func NewPrimaryKey ¶
func NewPrimaryKey(columnNames ...string) PrimaryKey
type StatementHandler ¶
type StatementHandler struct { *handler.ProjectionHandler Locker // contains filtered or unexported fields }
func NewStatementHandler ¶
func NewStatementHandler( ctx context.Context, config StatementHandlerConfig, ) StatementHandler
func (*StatementHandler) Init ¶
func (h *StatementHandler) Init(ctx context.Context, initialized chan<- bool, checks ...*handler.Check) error
Init implements handler.Init
func (*StatementHandler) SearchQuery ¶
func (h *StatementHandler) SearchQuery(ctx context.Context, instanceIDs []string) (*eventstore.SearchQueryBuilder, uint64, error)
type StatementHandlerConfig ¶
type SuffixedTable ¶
type SuffixedTable struct { Table // contains filtered or unexported fields }
func NewSuffixedTable ¶
func NewSuffixedTable(columns []*Column, key PrimaryKey, suffix string, opts ...TableOption) *SuffixedTable
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func NewTable ¶
func NewTable(columns []*Column, key PrimaryKey, opts ...TableOption) *Table
type TableOption ¶
type TableOption func(*Table)
func WithConstraint ¶
func WithConstraint(constraint *Constraint) TableOption
func WithForeignKey ¶
func WithForeignKey(key *ForeignKey) TableOption
func WithIndex ¶
func WithIndex(index *Index) TableOption
Click to show internal directories.
Click to hide internal directories.