sql

package
v0.0.0-...-60a21d4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dsn string) dbal.Grammar

Types

type Quoter

type Quoter struct {
	DB         *sqlx.DB
	DBPrimary  *sqlx.DB
	DBReadOnly *sqlx.DB
	Prefix     string
}

func (*Quoter) Bind

func (quoter *Quoter) Bind(db *sqlx.DB, prefix string, dbRead ...*sqlx.DB) dbal.Quoter

func (*Quoter) Columnize

func (quoter *Quoter) Columnize(columns []interface{}) string

func (*Quoter) ID

func (quoter *Quoter) ID(value string) string

func (*Quoter) IsExpression

func (quoter *Quoter) IsExpression(value interface{}) bool

func (*Quoter) Parameter

func (quoter *Quoter) Parameter(value interface{}, num int) string

func (*Quoter) Parameterize

func (quoter *Quoter) Parameterize(values []interface{}, offset int) string

func (*Quoter) Read

func (quoter *Quoter) Read() dbal.Quoter

func (*Quoter) VAL

func (quoter *Quoter) VAL(value interface{}) string

func (*Quoter) Wrap

func (quoter *Quoter) Wrap(value interface{}) string

func (*Quoter) WrapAliasedValue

func (quoter *Quoter) WrapAliasedValue(value string) string

func (*Quoter) WrapTable

func (quoter *Quoter) WrapTable(value interface{}) string

func (*Quoter) WrapUnion

func (quoter *Quoter) WrapUnion(sql string) string

func (*Quoter) Write

func (quoter *Quoter) Write() dbal.Quoter

type SQL

type SQL struct {
	Driver       string
	Mode         string
	Types        map[string]string
	FlipTypes    map[string]string
	IndexTypes   map[string]string
	DatabaseName string
	SchemaName   string
	DB           *sqlx.DB
	Config       *dbal.Config
	Read         *sqlx.DB
	ReadConfig   *dbal.Config
	Option       *dbal.Option
	dbal.Grammar
	dbal.Quoter
}

func NewSQL

func NewSQL(quoter dbal.Quoter) SQL

func (SQL) AlterTable

func (grammarSQL SQL) AlterTable(table *dbal.Table) error

func (SQL) CompileAggregate

func (grammarSQL SQL) CompileAggregate(query *dbal.Query, aggregate dbal.Aggregate) string

func (SQL) CompileColumns

func (grammarSQL SQL) CompileColumns(query *dbal.Query, columns []interface{}, bindingOffset *int) string

func (SQL) CompileDelete

func (grammarSQL SQL) CompileDelete(query *dbal.Query) (string, []interface{})

func (SQL) CompileExists

func (grammarSQL SQL) CompileExists(query *dbal.Query) string

func (SQL) CompileFrom

func (grammarSQL SQL) CompileFrom(query *dbal.Query, from dbal.From, bindingOffset *int) string

func (SQL) CompileGroups

func (grammarSQL SQL) CompileGroups(query *dbal.Query, groups []interface{}, bindingOffset *int) string

func (SQL) CompileHaving

func (grammarSQL SQL) CompileHaving(query *dbal.Query, having dbal.Having, bindingOffset *int) string

func (SQL) CompileHavings

func (grammarSQL SQL) CompileHavings(query *dbal.Query, havings []dbal.Having, bindingOffset *int) string

func (SQL) CompileInsert

func (grammarSQL SQL) CompileInsert(query *dbal.Query, columns []interface{}, values [][]interface{}) (string, []interface{})

func (SQL) CompileInsertGetID

func (grammarSQL SQL) CompileInsertGetID(query *dbal.Query, columns []interface{}, values [][]interface{}, sequence string) (string, []interface{})

func (SQL) CompileInsertOrIgnore

func (grammarSQL SQL) CompileInsertOrIgnore(query *dbal.Query, columns []interface{}, values [][]interface{}) (string, []interface{})

func (SQL) CompileInsertUsing

func (grammarSQL SQL) CompileInsertUsing(query *dbal.Query, columns []interface{}, sql string) string

func (SQL) CompileJoins

func (grammarSQL SQL) CompileJoins(query *dbal.Query, joins []dbal.Join, offset *int) string

func (SQL) CompileLimit

func (grammarSQL SQL) CompileLimit(query *dbal.Query, limit int, bindingOffset *int) string

func (SQL) CompileLock

func (grammarSQL SQL) CompileLock(query *dbal.Query, lock interface{}) string

func (SQL) CompileOffset

func (grammarSQL SQL) CompileOffset(query *dbal.Query, offset int) string

func (SQL) CompileOrders

func (grammarSQL SQL) CompileOrders(query *dbal.Query, orders []dbal.Order, bindingOffset *int) string

func (SQL) CompileSelect

func (grammarSQL SQL) CompileSelect(query *dbal.Query) string

func (SQL) CompileSelectOffset

func (grammarSQL SQL) CompileSelectOffset(query *dbal.Query, offset *int) string

func (SQL) CompileSub

func (grammarSQL SQL) CompileSub(sub interface{}, offset *int) string

func (SQL) CompileTruncate

func (grammarSQL SQL) CompileTruncate(query *dbal.Query) ([]string, [][]interface{})

func (SQL) CompileUnion

func (grammarSQL SQL) CompileUnion(query *dbal.Query, union dbal.Union, offset *int) string

func (SQL) CompileUnionAggregate

func (grammarSQL SQL) CompileUnionAggregate(query *dbal.Query) string

func (SQL) CompileUnions

func (grammarSQL SQL) CompileUnions(query *dbal.Query, unions []dbal.Union, offset *int) string

func (SQL) CompileUpdate

func (grammarSQL SQL) CompileUpdate(query *dbal.Query, values map[string]interface{}) (string, []interface{})

func (SQL) CompileUpdateColumns

func (grammarSQL SQL) CompileUpdateColumns(query *dbal.Query, values map[string]interface{}, offset *int) (string, []interface{})

func (SQL) CompileUpsert

func (grammarSQL SQL) CompileUpsert(query *dbal.Query, columns []interface{}, values [][]interface{}, uniqueBy []interface{}, updateValues interface{}) (string, []interface{})

func (SQL) CompileWheres

func (grammarSQL SQL) CompileWheres(query *dbal.Query, wheres []dbal.Where, bindingOffset *int) string

func (SQL) CreateTable

func (grammarSQL SQL) CreateTable(table *dbal.Table) error

func (SQL) DropTable

func (grammarSQL SQL) DropTable(name string) error

func (SQL) DropTableIfExists

func (grammarSQL SQL) DropTableIfExists(name string) error

func (SQL) ExecSQL

func (grammarSQL SQL) ExecSQL(table *dbal.Table, sql string) error

func (SQL) GetColumnListing

func (grammarSQL SQL) GetColumnListing(dbName string, tableName string) ([]*dbal.Column, error)

func (SQL) GetDatabase

func (grammarSQL SQL) GetDatabase() string

func (SQL) GetDefaultValue

func (grammarSQL SQL) GetDefaultValue(column *dbal.Column) string

func (SQL) GetIndexListing

func (grammarSQL SQL) GetIndexListing(dbName string, tableName string) ([]*dbal.Index, error)

func (SQL) GetOperators

func (grammarSQL SQL) GetOperators() []string

func (SQL) GetSchema

func (grammarSQL SQL) GetSchema() string

func (SQL) GetTable

func (grammarSQL SQL) GetTable(name string) (*dbal.Table, error)

func (SQL) GetTables

func (grammarSQL SQL) GetTables() ([]string, error)

func (SQL) GetTypeFromComment

func (grammarSQL SQL) GetTypeFromComment(comment *string) string

func (SQL) GetVersion

func (grammarSQL SQL) GetVersion() (*dbal.Version, error)

func (SQL) HavingBasic

func (grammarSQL SQL) HavingBasic(query *dbal.Query, having dbal.Having, bindingOffset *int) string

func (SQL) HavingBetween

func (grammarSQL SQL) HavingBetween(query *dbal.Query, having dbal.Having, bindingOffset *int) string

func (SQL) NewWith

func (grammarSQL SQL) NewWith(db *sqlx.DB, config *dbal.Config, option *dbal.Option) (dbal.Grammar, error)

func (SQL) NewWithRead

func (grammarSQL SQL) NewWithRead(write *sqlx.DB, writeConfig *dbal.Config, read *sqlx.DB, readConfig *dbal.Config, option *dbal.Option) (dbal.Grammar, error)

func (SQL) OnConnected

func (grammarSQL SQL) OnConnected() error

func (SQL) ProcessInsertGetID

func (grammarSQL SQL) ProcessInsertGetID(sql string, bindings []interface{}, sequence string) (int64, error)

func (SQL) Raw

func (grammarSQL SQL) Raw(value string) dbal.Expression

func (SQL) RemoveLeadingBoolean

func (grammarSQL SQL) RemoveLeadingBoolean(value string) string

func (SQL) RenameTable

func (grammarSQL SQL) RenameTable(old string, new string) error

func (SQL) SQLAddColumn

func (grammarSQL SQL) SQLAddColumn(column *dbal.Column) string

func (SQL) SQLAddIndex

func (grammarSQL SQL) SQLAddIndex(index *dbal.Index) string

func (SQL) SQLAddPrimary

func (grammarSQL SQL) SQLAddPrimary(primary *dbal.Primary) string

func (SQL) TableExists

func (grammarSQL SQL) TableExists(name string) (bool, error)

func (SQL) WhereBasic

func (grammarSQL SQL) WhereBasic(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereBetween

func (grammarSQL SQL) WhereBetween(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereColumn

func (grammarSQL SQL) WhereColumn(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereDate

func (grammarSQL SQL) WhereDate(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereDateBased

func (grammarSQL SQL) WhereDateBased(typ string, query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereDay

func (grammarSQL SQL) WhereDay(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereExists

func (grammarSQL SQL) WhereExists(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereIn

func (grammarSQL SQL) WhereIn(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereMonth

func (grammarSQL SQL) WhereMonth(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereNested

func (grammarSQL SQL) WhereNested(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereNotnull

func (grammarSQL SQL) WhereNotnull(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereNull

func (grammarSQL SQL) WhereNull(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereRaw

func (grammarSQL SQL) WhereRaw(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereSub

func (grammarSQL SQL) WhereSub(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereTime

func (grammarSQL SQL) WhereTime(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) WhereYear

func (grammarSQL SQL) WhereYear(query *dbal.Query, where dbal.Where, bindingOffset *int) string

func (SQL) Wrap

func (grammarSQL SQL) Wrap(value interface{}) string

func (SQL) WrapTable

func (grammarSQL SQL) WrapTable(value interface{}) string

Jump to

Keyboard shortcuts

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