Documentation ¶
Index ¶
- func New() dbal.Grammar
- type Postgres
- func (grammarSQL Postgres) AlterTable(table *dbal.Table) error
- func (grammarSQL Postgres) CompileColumns(query *dbal.Query, columns []interface{}, bindingOffset *int) string
- func (grammarSQL Postgres) CompileDelete(query *dbal.Query) (string, []interface{})
- func (grammarSQL Postgres) CompileInsertGetID(query *dbal.Query, columns []interface{}, values [][]interface{}, ...) (string, []interface{})
- func (grammarSQL Postgres) CompileInsertOrIgnore(query *dbal.Query, columns []interface{}, values [][]interface{}) (string, []interface{})
- func (grammarSQL Postgres) CompileLock(query *dbal.Query, lock interface{}) string
- func (grammarSQL Postgres) CompileSelect(query *dbal.Query) string
- func (grammarSQL Postgres) CompileSelectOffset(query *dbal.Query, offset *int) string
- func (grammarSQL Postgres) CompileTruncate(query *dbal.Query) ([]string, [][]interface{})
- func (grammarSQL Postgres) CompileUpdate(query *dbal.Query, values map[string]interface{}) (string, []interface{})
- func (grammarSQL Postgres) CompileUpsert(query *dbal.Query, columns []interface{}, values [][]interface{}, ...) (string, []interface{})
- func (grammarSQL Postgres) CompileWheres(query *dbal.Query, wheres []dbal.Where, bindingOffset *int) string
- func (grammarSQL Postgres) CreateTable(table *dbal.Table) error
- func (grammarSQL Postgres) CreateType(table *dbal.Table, types map[string][]string) error
- func (grammarSQL Postgres) ExecSQL(table *dbal.Table, sql string) error
- func (grammarSQL Postgres) GetColumnListing(dbName string, tableName string) ([]*dbal.Column, error)
- func (grammarSQL Postgres) GetIndexListing(dbName string, tableName string) ([]*dbal.Index, error)
- func (grammarSQL Postgres) GetOperators() []string
- func (grammarSQL Postgres) GetTable(name string) (*dbal.Table, error)
- func (grammarSQL Postgres) GetTables() ([]string, error)
- func (grammarSQL Postgres) GetVersion() (*dbal.Version, error)
- func (grammarSQL Postgres) NewWith(db *sqlx.DB, config *dbal.Config, option *dbal.Option) (dbal.Grammar, error)
- func (grammarSQL Postgres) NewWithRead(write *sqlx.DB, writeConfig *dbal.Config, read *sqlx.DB, ...) (dbal.Grammar, error)
- func (grammarSQL Postgres) ProcessInsertGetID(sql string, bindings []interface{}, sequence string) (int64, error)
- func (grammarSQL Postgres) RenameTable(old string, new string) error
- func (grammarSQL Postgres) SQLAddColumn(column *dbal.Column) string
- func (grammarSQL Postgres) SQLAddComment(column *dbal.Column) string
- func (grammarSQL Postgres) SQLAddIndex(index *dbal.Index) string
- func (grammarSQL Postgres) SQLAddPrimary(primary *dbal.Primary) string
- func (grammarSQL Postgres) SQLAlterColumnType(Column *dbal.Column) string
- func (grammarSQL Postgres) SQLAlterIndex(index *dbal.Index) string
- func (grammarSQL Postgres) TableExists(name string) (bool, error)
- func (grammarSQL Postgres) Upsert(query *dbal.Query, values []xun.R, uniqueBy []interface{}, ...) (sql.Result, error)
- func (grammarSQL Postgres) WhereDate(query *dbal.Query, where dbal.Where, bindingOffset *int) string
- func (grammarSQL Postgres) WhereDateBased(typ string, query *dbal.Query, where dbal.Where, bindingOffset *int) string
- func (grammarSQL Postgres) WhereDay(query *dbal.Query, where dbal.Where, bindingOffset *int) string
- func (grammarSQL Postgres) WhereMonth(query *dbal.Query, where dbal.Where, bindingOffset *int) string
- func (grammarSQL Postgres) WhereTime(query *dbal.Query, where dbal.Where, bindingOffset *int) string
- func (grammarSQL Postgres) WhereYear(query *dbal.Query, where dbal.Where, bindingOffset *int) string
- type Quoter
- func (quoter *Quoter) Columnize(columns []interface{}) string
- func (quoter Quoter) ID(name string) string
- func (quoter *Quoter) Parameter(value interface{}, num int) string
- func (quoter *Quoter) Parameterize(values []interface{}, offset int) string
- func (quoter Quoter) VAL(v interface{}) string
- func (quoter *Quoter) Wrap(value interface{}) string
- func (quoter *Quoter) WrapAliasedValue(value string) string
- func (quoter *Quoter) WrapTable(value interface{}) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Postgres ¶
Postgres the Postgresql Grammar
func (Postgres) AlterTable ¶
AlterTable alter a table on the schema
func (Postgres) CompileColumns ¶ added in v0.5.1
func (grammarSQL Postgres) CompileColumns(query *dbal.Query, columns []interface{}, bindingOffset *int) string
CompileColumns Compile the "select *" portion of the query.
func (Postgres) CompileDelete ¶ added in v0.5.1
CompileDelete Compile a delete statement into SQL.
func (Postgres) CompileInsertGetID ¶ added in v0.5.1
func (grammarSQL Postgres) CompileInsertGetID(query *dbal.Query, columns []interface{}, values [][]interface{}, sequence string) (string, []interface{})
CompileInsertGetID Compile an insert and get ID statement into SQL.
func (Postgres) CompileInsertOrIgnore ¶ added in v0.5.1
func (grammarSQL Postgres) CompileInsertOrIgnore(query *dbal.Query, columns []interface{}, values [][]interface{}) (string, []interface{})
CompileInsertOrIgnore Compile an insert ignore statement into SQL.
func (Postgres) CompileLock ¶ added in v0.5.1
CompileLock the lock into SQL.
func (Postgres) CompileSelect ¶ added in v0.5.1
CompileSelect Compile a select query into SQL.
func (Postgres) CompileSelectOffset ¶ added in v0.5.1
CompileSelectOffset Compile a select query into SQL.
func (Postgres) CompileTruncate ¶ added in v0.5.1
CompileTruncate Compile a truncate table statement into SQL.
func (Postgres) CompileUpdate ¶ added in v0.5.1
func (grammarSQL Postgres) CompileUpdate(query *dbal.Query, values map[string]interface{}) (string, []interface{})
CompileUpdate Compile an update statement into SQL.
func (Postgres) CompileUpsert ¶ added in v0.5.1
func (grammarSQL Postgres) CompileUpsert(query *dbal.Query, columns []interface{}, values [][]interface{}, uniqueBy []interface{}, updateValues interface{}) (string, []interface{})
CompileUpsert Upsert new records or update the existing ones.
func (Postgres) CompileWheres ¶ added in v0.5.1
func (grammarSQL Postgres) CompileWheres(query *dbal.Query, wheres []dbal.Where, bindingOffset *int) string
CompileWheres Compile an update statement into SQL.
func (Postgres) CreateTable ¶
CreateTable create a new table on the schema
func (Postgres) CreateType ¶
CreateType create user defined type
func (Postgres) GetColumnListing ¶
func (grammarSQL Postgres) GetColumnListing(dbName string, tableName string) ([]*dbal.Column, error)
GetColumnListing get a table columns structure
func (Postgres) GetIndexListing ¶
GetIndexListing get a table indexes structure
func (Postgres) GetOperators ¶ added in v0.5.1
GetOperators get the operators
func (Postgres) GetVersion ¶
GetVersion get the version of the connection database
func (Postgres) NewWith ¶
func (grammarSQL Postgres) NewWith(db *sqlx.DB, config *dbal.Config, option *dbal.Option) (dbal.Grammar, error)
NewWith Create a new grammar interface, using the given *sqlx.DB, *dbal.Config and *dbal.Option.
func (Postgres) NewWithRead ¶ added in v0.5.1
func (grammarSQL Postgres) NewWithRead(write *sqlx.DB, writeConfig *dbal.Config, read *sqlx.DB, readConfig *dbal.Config, option *dbal.Option) (dbal.Grammar, error)
NewWithRead Create a new grammar interface, using the given *sqlx.DB, *dbal.Config and *dbal.Option.
func (Postgres) ProcessInsertGetID ¶ added in v0.5.1
func (grammarSQL Postgres) ProcessInsertGetID(sql string, bindings []interface{}, sequence string) (int64, error)
ProcessInsertGetID Execute an insert and get ID statement and return the id
func (Postgres) RenameTable ¶
RenameTable rename a table on the schema.
func (Postgres) SQLAddColumn ¶
SQLAddColumn return the add column sql for table create
func (Postgres) SQLAddComment ¶
SQLAddComment return the add comment sql for table create
func (Postgres) SQLAddIndex ¶
SQLAddIndex return the add index sql for table create
func (Postgres) SQLAddPrimary ¶
SQLAddPrimary return the add primary key sql for table create
func (Postgres) SQLAlterColumnType ¶
SQLAlterColumnType return the add column sql for table alter
func (Postgres) SQLAlterIndex ¶
SQLAlterIndex return the add index sql for table alter
func (Postgres) TableExists ¶
TableExists check if the table exists
func (Postgres) Upsert ¶ added in v0.5.1
func (grammarSQL Postgres) Upsert(query *dbal.Query, values []xun.R, uniqueBy []interface{}, updateValues interface{}) (sql.Result, error)
Upsert Upsert new records or update the existing ones.
func (Postgres) WhereDate ¶ added in v0.5.1
func (grammarSQL Postgres) WhereDate(query *dbal.Query, where dbal.Where, bindingOffset *int) string
WhereDate Compile a "where date" clause.
func (Postgres) WhereDateBased ¶ added in v0.5.1
func (grammarSQL Postgres) WhereDateBased(typ string, query *dbal.Query, where dbal.Where, bindingOffset *int) string
WhereDateBased Compile a date based where clause.
func (Postgres) WhereMonth ¶ added in v0.5.1
func (grammarSQL Postgres) WhereMonth(query *dbal.Query, where dbal.Where, bindingOffset *int) string
WhereMonth Compile a "where month" clause.
type Quoter ¶
Quoter the database quoting query text SQL type
func (*Quoter) Columnize ¶ added in v0.5.1
Columnize Convert an array of column names into a delimited string.
func (*Quoter) Parameter ¶ added in v0.5.1
Parameter Get the appropriate query parameter place-holder for a value.
func (*Quoter) Parameterize ¶ added in v0.5.1
Parameterize Create query parameter place-holders for an array.
func (*Quoter) WrapAliasedValue ¶ added in v0.5.1
WrapAliasedValue Wrap a value that has an alias.