builder

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotCompareUsingInOperator = errors.New(`cannot use "in" operator to compare the specified values`)

Functions

func LiteralToSQLOperand

func LiteralToSQLOperand(literal interface{}) (string, []interface{})

func NewExpressionSqlizer

func NewExpressionSqlizer(alias string, fieldType skydb.FieldType, expr skydb.Expression) sq.Sqlizer

func RequireCast

func RequireCast(sqlizer sq.Sqlizer) (sq.Sqlizer, error)

func SortOrderBySQL

func SortOrderBySQL(alias string, sort skydb.Sort) (string, error)

Types

type FalseSqlizer

type FalseSqlizer struct {
}

FalseSqlizer generates SQL condition that evaluates to false

func (FalseSqlizer) ToSql

func (s FalseSqlizer) ToSql() (sql string, args []interface{}, err error)

ToSql generates SQL for FalseSqlizer

type NotSqlizer

type NotSqlizer struct {
	Predicate sq.Sqlizer
}

NotSqlizer generates SQL condition that negates a boolean condition

func (NotSqlizer) ToSql

func (s NotSqlizer) ToSql() (sql string, args []interface{}, err error)

ToSql generates SQL for NotSqlizer

type PredicateSqlizerFactory

type PredicateSqlizerFactory interface {
	UpdateTypemap(typemap skydb.RecordSchema) skydb.RecordSchema
	AddJoinsToSelectBuilder(q sq.SelectBuilder) sq.SelectBuilder
	NewPredicateSqlizer(p skydb.Predicate) (sq.Sqlizer, error)
	NewAccessControlSqlizer(user *skydb.AuthInfo, aclLevel skydb.RecordACLLevel) (sq.Sqlizer, error)
}

func NewPredicateSqlizerFactory

func NewPredicateSqlizerFactory(db skydb.Database, primaryTable string) PredicateSqlizerFactory

type UpsertQueryBuilder

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

UpsertQueryBuilder is a sqlizer for INSERT ON CONFLICT UPDATE SQL.

func UpsertQuery

func UpsertQuery(table string, pkData, data map[string]interface{}) *UpsertQueryBuilder

UpsertQuery creates a new UpsertQueryBuilder.

func UpsertQueryWithWrappers

func UpsertQueryWithWrappers(table string, pkData, data map[string]interface{}, wrappers map[string]func(string) string) *UpsertQueryBuilder

func (*UpsertQueryBuilder) IgnoreKeyOnUpdate

func (upsert *UpsertQueryBuilder) IgnoreKeyOnUpdate(col string) *UpsertQueryBuilder

func (*UpsertQueryBuilder) SelectColumn

func (upsert *UpsertQueryBuilder) SelectColumn(col string, sqlizer sq.Sqlizer) *UpsertQueryBuilder

func (*UpsertQueryBuilder) ToSql

func (upsert *UpsertQueryBuilder) ToSql() (sql string, args []interface{}, err error)

Jump to

Keyboard shortcuts

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