Documentation
¶
Index ¶
- Constants
- Variables
- func CascadeOnTruncate(value bool)
- func CustomOperators(operators []any)
- func NewConnector(endpoint database.Config) (driver.Connector, error)
- type Config
- type Dialect
- func (d *Dialect) Escape(value any, binary bool) (string, error)
- func (*Dialect) Name() string
- func (*Dialect) NewConnector(endpoint database.Config) (driver.Connector, error)
- func (*Dialect) NewProcessor() contractsquery.Processor
- func (*Dialect) NewQueryGrammar(options contractsdriver.GrammarOptions) contractsquery.Grammar
- func (*Dialect) ServerVersionSQL() string
- type Grammar
- type Postgres
- func (r *Postgres) Dialect() driver.Dialect
- func (r *Postgres) Docker() (docker.DatabaseDriver, error)
- func (r *Postgres) Grammar() driver.Grammar
- func (r *Postgres) Pool() database.Pool
- func (r *Postgres) Processor() driver.Processor
- func (r *Postgres) SetServerVersion(resolver func() (string, error))
- type Processor
- func (r Processor) ProcessColumns(values []driver.DBColumn) []driver.Column
- func (r Processor) ProcessForeignKeys(values []driver.DBForeignKey) []driver.ForeignKey
- func (r Processor) ProcessIndexes(values []driver.DBIndex) []driver.Index
- func (r Processor) ProcessTypes(values []driver.Type) []driver.Type
- type QueryGrammar
- func (g *QueryGrammar) CompileColumns(b core.Query, columns []any) string
- func (g *QueryGrammar) CompileDelete(b core.Query) string
- func (g *QueryGrammar) CompileHaving(b core.Query, having core.Having) string
- func (g *QueryGrammar) CompileInsertGetId(b core.Query, values []map[string]any, sequence string) string
- func (g *QueryGrammar) CompileInsertOrIgnore(b core.Query, values []map[string]any) string
- func (g *QueryGrammar) CompileInsertOrIgnoreUsing(b core.Query, columns []any, sql string) string
- func (g *QueryGrammar) CompileJoinLateral(join core.Join, expression string) string
- func (g *QueryGrammar) CompileJsonContains(column string, value string) string
- func (g *QueryGrammar) CompileJsonContainsKey(column string) string
- func (g *QueryGrammar) CompileJsonLength(column string, operator string, value string) string
- func (g *QueryGrammar) CompileJsonUpdateColumn(key string, value any) string
- func (g *QueryGrammar) CompileLock(b core.Query, value any) string
- func (g *QueryGrammar) CompileRandom(seed any) string
- func (g *QueryGrammar) CompileTruncate(b core.Query) []core.Statement
- func (g *QueryGrammar) CompileUpdate(b core.Query, values core.UpdateValues) string
- func (g *QueryGrammar) CompileUpdateColumns(b core.Query, values core.UpdateValues) string
- func (g *QueryGrammar) CompileUpdateFrom(b core.Query, values core.UpdateValues) string
- func (g *QueryGrammar) CompileUpdateJoinWheres(b core.Query) string
- func (g *QueryGrammar) CompileUpdateWheres(b core.Query) string
- func (g *QueryGrammar) CompileUpsert(b core.Query, values []map[string]any, uniqueBy []string, ...) string
- func (g *QueryGrammar) GetBitwiseOperators() []string
- func (g *QueryGrammar) GetOperators() []string
- func (g *QueryGrammar) ParseJsonPathArrayKeys(attribute string) []string
- func (g *QueryGrammar) PrepareBindingsForUpdate(bindings map[string][]any, values core.UpdateValues) []any
- func (g *QueryGrammar) PrepareBindingsForUpdateFrom(bindings map[string][]any, values core.UpdateValues) []any
- func (g *QueryGrammar) SubstituteBindingsIntoRawSQL(sql string, bindings []any) string
- func (g *QueryGrammar) WhereBasic(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereBitwise(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereDate(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereDay(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereFullText(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereLike(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereMonth(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereTime(b core.Query, where core.Where) string
- func (g *QueryGrammar) WhereYear(b core.Query, where core.Where) string
- func (g *QueryGrammar) WrapJsonBooleanSelector(value string) string
- func (g *QueryGrammar) WrapJsonBooleanValue(value string) string
- func (g *QueryGrammar) WrapJsonPathAttributes(path []string, quote string) []string
- func (g *QueryGrammar) WrapJsonSelector(value string) string
- type QueryProcessor
- func (p *QueryProcessor) ProcessColumns(results []contractsquery.Row, sql ...string) []contractsquery.Row
- func (p *QueryProcessor) ProcessForeignKeys(rows []contractsquery.Row) []contractsquery.Row
- func (p *QueryProcessor) ProcessIndexes(rows []contractsquery.Row) []contractsquery.Row
- func (p *QueryProcessor) ProcessInsertGetID(connection contractsquery.Connection, statement string, values []any, ...) (any, error)
- func (p *QueryProcessor) ProcessTypes(results []contractsquery.Row) []contractsquery.Row
- type SchemaGrammar
- func (r *SchemaGrammar) CompileAdd(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileChange(blueprint driver.Blueprint, command *driver.Command) []string
- func (r *SchemaGrammar) CompileColumns(schema, table string) (string, error)
- func (r *SchemaGrammar) CompileComment(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileCreate(blueprint driver.Blueprint) string
- func (r *SchemaGrammar) CompileDefault(_ driver.Blueprint, _ *driver.Command) string
- func (r *SchemaGrammar) CompileDrop(blueprint driver.Blueprint) string
- func (r *SchemaGrammar) CompileDropAllDomains(domains []string) string
- func (r *SchemaGrammar) CompileDropAllTables(schema string, tables []driver.Table) []string
- func (r *SchemaGrammar) CompileDropAllTypes(schema string, types []driver.Type) []string
- func (r *SchemaGrammar) CompileDropAllViews(schema string, views []driver.View) []string
- func (r *SchemaGrammar) CompileDropColumn(blueprint driver.Blueprint, command *driver.Command) []string
- func (r *SchemaGrammar) CompileDropForeign(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileDropFullText(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileDropIfExists(blueprint driver.Blueprint) string
- func (r *SchemaGrammar) CompileDropIndex(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileDropPrimary(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileDropUnique(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileForeign(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileForeignKeys(schema, table string) string
- func (r *SchemaGrammar) CompileFullText(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileInRandomOrder(builder sq.SelectBuilder, conditions *driver.Conditions) sq.SelectBuilder
- func (r *SchemaGrammar) CompileIndex(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileIndexes(schema, table string) (string, error)
- func (r *SchemaGrammar) CompileJsonColumnsUpdate(values map[string]any) (map[string]any, error)
- func (r *SchemaGrammar) CompileJsonContains(column string, value any, isNot bool) (string, []any, error)
- func (r *SchemaGrammar) CompileJsonContainsKey(column string, isNot bool) string
- func (r *SchemaGrammar) CompileJsonLength(column string) string
- func (r *SchemaGrammar) CompileJsonSelector(column string) string
- func (r *SchemaGrammar) CompileJsonValues(args ...any) []any
- func (r *SchemaGrammar) CompileLockForUpdate(builder sq.SelectBuilder, conditions *driver.Conditions) sq.SelectBuilder
- func (r *SchemaGrammar) CompileLockForUpdateForGorm() any
- func (r *SchemaGrammar) CompilePlaceholderFormat() driver.PlaceholderFormat
- func (r *SchemaGrammar) CompilePrimary(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompilePrune(_ string) string
- func (r *SchemaGrammar) CompileRandomOrderForGorm() string
- func (r *SchemaGrammar) CompileRename(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileRenameColumn(blueprint driver.Blueprint, command *driver.Command, _ []driver.Column) (string, error)
- func (r *SchemaGrammar) CompileRenameIndex(blueprint driver.Blueprint, command *driver.Command, _ []driver.Index) []string
- func (r *SchemaGrammar) CompileSchemaBlueprint(blueprint driver.Blueprint, catalog driver.SchemaCatalog) ([]driver.SchemaStatement, bool, error)
- func (r *SchemaGrammar) CompileSchemaCommand(blueprint driver.Blueprint, command *driver.Command) ([]driver.SchemaStatement, bool, error)
- func (r *SchemaGrammar) CompileSchemaMetadata(query driver.SchemaMetadataQuery) (driver.SchemaStatement, error)
- func (r *SchemaGrammar) CompileSchemaOperation(operation driver.SchemaOperation) ([]driver.SchemaStatement, error)
- func (r *SchemaGrammar) CompileSchemaStartingValues(blueprint driver.Blueprint) ([]driver.SchemaStatement, error)
- func (r *SchemaGrammar) CompileSharedLock(builder sq.SelectBuilder, conditions *driver.Conditions) sq.SelectBuilder
- func (r *SchemaGrammar) CompileSharedLockForGorm() any
- func (r *SchemaGrammar) CompileTableComment(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileTables(_ string) string
- func (r *SchemaGrammar) CompileTypes() string
- func (r *SchemaGrammar) CompileUnique(blueprint driver.Blueprint, command *driver.Command) string
- func (r *SchemaGrammar) CompileVersion() string
- func (r *SchemaGrammar) CompileViews(database string) string
- func (*SchemaGrammar) CurrentSchemas(string) []string
- func (r *SchemaGrammar) EscapeNames(names []string) []string
- func (*SchemaGrammar) ForeignKeyStateQuery() string
- func (r *SchemaGrammar) GetAttributeCommands() []string
- func (r *SchemaGrammar) ModifyDefault(_ driver.Blueprint, column driver.ColumnDefinition) string
- func (r *SchemaGrammar) ModifyGeneratedAs(_ driver.Blueprint, column driver.ColumnDefinition) string
- func (r *SchemaGrammar) ModifyGeneratedAsForChange(_ driver.Blueprint, column driver.ColumnDefinition) string
- func (r *SchemaGrammar) ModifyIncrement(blueprint driver.Blueprint, column driver.ColumnDefinition) string
- func (r *SchemaGrammar) ModifyNullable(_ driver.Blueprint, column driver.ColumnDefinition) string
- func (r *SchemaGrammar) ResolveCurrentSchemas(_ driver.SchemaConnectionInfo, catalog driver.SchemaCatalog) ([]string, error)
- func (r *SchemaGrammar) SchemaExecutionPolicy(blueprint driver.Blueprint) driver.SchemaExecutionPolicy
- func (*SchemaGrammar) SchemaOperationPolicy(operation driver.SchemaOperation) driver.SchemaExecutionPolicy
- func (r *SchemaGrammar) SetVersionResolver(resolver func() (string, error))
- func (r *SchemaGrammar) TypeBigInteger(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeBoolean(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeChar(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeDate(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeDateTime(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeDateTimeTz(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeDecimal(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeDouble(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeEnum(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeFloat(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeInteger(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeJson(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeJsonb(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeLongText(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeMediumInteger(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeMediumText(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeSmallInteger(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeString(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeText(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeTime(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeTimeTz(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeTimestamp(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeTimestampTz(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeTinyInteger(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeTinyText(column driver.ColumnDefinition) string
- func (r *SchemaGrammar) TypeUuid(column driver.ColumnDefinition) string
- type ServiceProvider
Constants ¶
const ( Binding = "gradii.postgres" Name = "PostgreSQL" )
Variables ¶
var App foundation.Application
Functions ¶
func CascadeOnTruncate ¶
func CascadeOnTruncate(value bool)
CascadeOnTruncate mirrors PostgresGrammar::cascadeOnTruncate(): it turns the "cascade" keyword a truncate statement appends on or off. The default is on, matching Laravel. The flag is process-wide, so a caller that flips it should restore the previous value.
func CustomOperators ¶
func CustomOperators(operators []any)
CustomOperators ports QueryGrammar::customOperators: valid strings are appended process-wide.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) Connection ¶
func (*Config) Readers ¶
func (r *Config) Readers() []contracts.FullConfig
func (*Config) Writers ¶
func (r *Config) Writers() []contracts.FullConfig
type Dialect ¶
type Dialect struct{}
func NewDialect ¶
func NewDialect() *Dialect
func (*Dialect) Escape ¶
Escape formats a PostgreSQL scalar literal for SQL previews. Query execution uses bound parameters, independently of this presentation-only operation.
func (*Dialect) NewConnector ¶
func (*Dialect) NewProcessor ¶
func (*Dialect) NewProcessor() contractsquery.Processor
func (*Dialect) NewQueryGrammar ¶
func (*Dialect) NewQueryGrammar(options contractsdriver.GrammarOptions) contractsquery.Grammar
func (*Dialect) ServerVersionSQL ¶
type Grammar ¶
type Grammar = SchemaGrammar
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func NewPostgres ¶
NewPostgres keeps the legacy constructor while the framework owns SQL pools.
func (*Postgres) SetServerVersion ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor adapts the legacy typed metadata contract to the canonical query processor.
func NewProcessor ¶
func NewProcessor() *Processor
func (Processor) ProcessColumns ¶
func (Processor) ProcessForeignKeys ¶
func (r Processor) ProcessForeignKeys(values []driver.DBForeignKey) []driver.ForeignKey
func (Processor) ProcessIndexes ¶
type QueryGrammar ¶
type QueryGrammar struct {
*grammars.BaseGrammar
}
QueryGrammar mirrors Illuminate\Database\Query\Grammars\PostgresGrammar. Only the methods whose SQL differs from the base are declared here.
func NewQueryGrammar ¶
func NewQueryGrammar(prefix string) *QueryGrammar
NewQueryGrammar creates the Postgres grammar.
func (*QueryGrammar) CompileColumns ¶
func (g *QueryGrammar) CompileColumns(b core.Query, columns []any) string
CompileColumns mirrors PostgresGrammar::compileColumns(), which supports distinct on.
func (*QueryGrammar) CompileDelete ¶
func (g *QueryGrammar) CompileDelete(b core.Query) string
CompileDelete mirrors PostgresGrammar::compileDelete(): joins or a limit take the ctid rewrite.
func (*QueryGrammar) CompileHaving ¶
CompileHaving mirrors PostgresGrammar::compileHaving().
func (*QueryGrammar) CompileInsertGetId ¶
func (g *QueryGrammar) CompileInsertGetId(b core.Query, values []map[string]any, sequence string) string
CompileInsertGetId mirrors PostgresGrammar::compileInsertGetId(): insert then returning.
func (*QueryGrammar) CompileInsertOrIgnore ¶
CompileInsertOrIgnore mirrors PostgresGrammar::compileInsertOrIgnore(): the conflict clause is what ignores the row, so the statement is an ordinary insert with one appended.
func (*QueryGrammar) CompileInsertOrIgnoreUsing ¶
CompileInsertOrIgnoreUsing mirrors PostgresGrammar::compileInsertOrIgnoreUsing().
func (*QueryGrammar) CompileJoinLateral ¶
func (g *QueryGrammar) CompileJoinLateral(join core.Join, expression string) string
CompileJoinLateral mirrors PostgresGrammar::compileJoinLateral(): Postgres supports lateral joins and spells them the same way MySQL does.
func (*QueryGrammar) CompileJsonContains ¶
func (g *QueryGrammar) CompileJsonContains(column string, value string) string
CompileJsonContains mirrors PostgresGrammar::compileJsonContains().
func (*QueryGrammar) CompileJsonContainsKey ¶
func (g *QueryGrammar) CompileJsonContainsKey(column string) string
CompileJsonContainsKey mirrors PostgresGrammar::compileJsonContainsKey().
func (*QueryGrammar) CompileJsonLength ¶
func (g *QueryGrammar) CompileJsonLength(column string, operator string, value string) string
CompileJsonLength mirrors PostgresGrammar::compileJsonLength().
func (*QueryGrammar) CompileJsonUpdateColumn ¶
func (g *QueryGrammar) CompileJsonUpdateColumn(key string, value any) string
CompileJsonUpdateColumn mirrors PostgresGrammar::compileJsonUpdateColumn().
func (*QueryGrammar) CompileLock ¶
func (g *QueryGrammar) CompileLock(b core.Query, value any) string
CompileLock mirrors PostgresGrammar::compileLock().
func (*QueryGrammar) CompileRandom ¶
func (g *QueryGrammar) CompileRandom(seed any) string
CompileRandom mirrors PostgresGrammar, which keeps the base RANDOM().
func (*QueryGrammar) CompileTruncate ¶
func (g *QueryGrammar) CompileTruncate(b core.Query) []core.Statement
CompileTruncate mirrors PostgresGrammar::compileTruncate(): restart identity, then the cascade keyword unless CascadeOnTruncate(false) disabled it.
func (*QueryGrammar) CompileUpdate ¶
func (g *QueryGrammar) CompileUpdate(b core.Query, values core.UpdateValues) string
CompileUpdate mirrors PostgresGrammar::compileUpdate(): joins or a limit take the ctid rewrite.
func (*QueryGrammar) CompileUpdateColumns ¶
func (g *QueryGrammar) CompileUpdateColumns(b core.Query, values core.UpdateValues) string
CompileUpdateColumns mirrors PostgresGrammar::compileUpdateColumns(): the key is reduced to its last dot-segment before wrapping (so a qualified update column assigns to the bare column), and JSON selectors use jsonb_set. The isJsonSelector test still runs against the full key, exactly as Laravel does, but the reduced column is what compileJsonUpdateColumn receives.
Postgres rejects more than one assignment to the same column ("multiple assignments to same column"), so a column's JSON selectors are fused into one nested jsonb_set chain at the first selector's position: jsonb_set(jsonb_set(col::jsonb, path1, ?), path2, ?). Laravel leaves them as separate assignments, which only survives on a driver that permits the duplicate. Every other assignment keeps its position and its value.
func (*QueryGrammar) CompileUpdateFrom ¶
func (g *QueryGrammar) CompileUpdateFrom(b core.Query, values core.UpdateValues) string
CompileUpdateFrom mirrors PostgresGrammar::compileUpdateFrom().
func (*QueryGrammar) CompileUpdateJoinWheres ¶
func (g *QueryGrammar) CompileUpdateJoinWheres(b core.Query) string
CompileUpdateJoinWheres mirrors PostgresGrammar::compileUpdateJoinWheres().
func (*QueryGrammar) CompileUpdateWheres ¶
func (g *QueryGrammar) CompileUpdateWheres(b core.Query) string
CompileUpdateWheres mirrors PostgresGrammar::compileUpdateWheres().
func (*QueryGrammar) CompileUpsert ¶
func (g *QueryGrammar) CompileUpsert(b core.Query, values []map[string]any, uniqueBy []string, update []core.UpsertUpdate) string
CompileUpsert mirrors PostgresGrammar::compileUpsert(): on conflict do update.
func (*QueryGrammar) GetBitwiseOperators ¶
func (g *QueryGrammar) GetBitwiseOperators() []string
GetBitwiseOperators mirrors PostgresGrammar::$bitwiseOperators, which adds "#" and the shift spellings to the base Builder set so those clauses compile through whereBitwise().
func (*QueryGrammar) GetOperators ¶
func (g *QueryGrammar) GetOperators() []string
GetOperators merges the built-in and custom operators into a unique, ordered list.
func (*QueryGrammar) ParseJsonPathArrayKeys ¶
func (g *QueryGrammar) ParseJsonPathArrayKeys(attribute string) []string
ParseJsonPathArrayKeys mirrors PostgresGrammar::parseJsonPathArrayKeys().
func (*QueryGrammar) PrepareBindingsForUpdate ¶
func (g *QueryGrammar) PrepareBindingsForUpdate(bindings map[string][]any, values core.UpdateValues) []any
PrepareBindingsForUpdate mirrors PostgresGrammar::prepareBindingsForUpdate(): array values and non-expression JSON selectors are encoded before binding. The assignments are grouped first so the bindings of a column's several JSON selectors travel together in the order the merged jsonb_set chain consumes them, keeping the placeholders aligned with the bindings exactly as CompileUpdateColumns emits them.
func (*QueryGrammar) PrepareBindingsForUpdateFrom ¶
func (g *QueryGrammar) PrepareBindingsForUpdateFrom(bindings map[string][]any, values core.UpdateValues) []any
PrepareBindingsForUpdateFrom mirrors PostgresGrammar::prepareBindingsForUpdateFrom().
func (*QueryGrammar) SubstituteBindingsIntoRawSQL ¶
func (g *QueryGrammar) SubstituteBindingsIntoRawSQL(sql string, bindings []any) string
SubstituteBindingsIntoRawSQL restores escaped PostgreSQL question-mark operators.
func (*QueryGrammar) WhereBasic ¶
WhereBasic mirrors PostgresGrammar::whereBasic(): a like comparison casts the column to text.
func (*QueryGrammar) WhereBitwise ¶
WhereBitwise mirrors PostgresGrammar::whereBitwise().
func (*QueryGrammar) WhereFullText ¶
WhereFullText mirrors PostgresGrammar::whereFullText().
func (*QueryGrammar) WhereLike ¶
WhereLike mirrors PostgresGrammar::whereLike(): the default match is case insensitive.
func (*QueryGrammar) WhereMonth ¶
WhereMonth mirrors PostgresGrammar::whereMonth().
func (*QueryGrammar) WhereTime ¶
WhereTime mirrors PostgresGrammar::whereTime(): the column is cast to time rather than read out with extract(), and a JSON selector is parenthesised before the cast the way the date clause is.
func (*QueryGrammar) WrapJsonBooleanSelector ¶
func (g *QueryGrammar) WrapJsonBooleanSelector(value string) string
WrapJsonBooleanSelector mirrors PostgresGrammar::wrapJsonBooleanSelector().
func (*QueryGrammar) WrapJsonBooleanValue ¶
func (g *QueryGrammar) WrapJsonBooleanValue(value string) string
WrapJsonBooleanValue mirrors PostgresGrammar::wrapJsonBooleanValue().
func (*QueryGrammar) WrapJsonPathAttributes ¶
func (g *QueryGrammar) WrapJsonPathAttributes(path []string, quote string) []string
WrapJsonPathAttributes mirrors PostgresGrammar::wrapJsonPathAttributes().
func (*QueryGrammar) WrapJsonSelector ¶
func (g *QueryGrammar) WrapJsonSelector(value string) string
WrapJsonSelector mirrors PostgresGrammar::wrapJsonSelector(): native -> and ->> operators.
type QueryProcessor ¶
type QueryProcessor struct{ processors.BaseProcessor }
QueryProcessor reads the row produced by RETURNING on the write connection. This ports QueryProcessor::processInsertGetId without inferring the result shape from SQL text.
func NewQueryProcessor ¶
func NewQueryProcessor() *QueryProcessor
func (*QueryProcessor) ProcessColumns ¶
func (p *QueryProcessor) ProcessColumns(results []contractsquery.Row, sql ...string) []contractsquery.Row
ProcessColumns ports QueryProcessor::processColumns.
func (*QueryProcessor) ProcessForeignKeys ¶
func (p *QueryProcessor) ProcessForeignKeys(rows []contractsquery.Row) []contractsquery.Row
func (*QueryProcessor) ProcessIndexes ¶
func (p *QueryProcessor) ProcessIndexes(rows []contractsquery.Row) []contractsquery.Row
func (*QueryProcessor) ProcessInsertGetID ¶
func (p *QueryProcessor) ProcessInsertGetID(connection contractsquery.Connection, statement string, values []any, sequence string) (any, error)
func (*QueryProcessor) ProcessTypes ¶
func (p *QueryProcessor) ProcessTypes(results []contractsquery.Row) []contractsquery.Row
type SchemaGrammar ¶
type SchemaGrammar struct {
// contains filtered or unexported fields
}
func NewGrammar ¶
func NewGrammar(prefix string) *SchemaGrammar
func NewSchemaGrammar ¶
func NewSchemaGrammar(prefix string) *SchemaGrammar
func (*SchemaGrammar) CompileAdd ¶
func (*SchemaGrammar) CompileChange ¶
func (*SchemaGrammar) CompileColumns ¶
func (r *SchemaGrammar) CompileColumns(schema, table string) (string, error)
func (*SchemaGrammar) CompileComment ¶
func (*SchemaGrammar) CompileCreate ¶
func (r *SchemaGrammar) CompileCreate(blueprint driver.Blueprint) string
func (*SchemaGrammar) CompileDefault ¶
func (*SchemaGrammar) CompileDrop ¶
func (r *SchemaGrammar) CompileDrop(blueprint driver.Blueprint) string
func (*SchemaGrammar) CompileDropAllDomains ¶
func (r *SchemaGrammar) CompileDropAllDomains(domains []string) string
func (*SchemaGrammar) CompileDropAllTables ¶
func (r *SchemaGrammar) CompileDropAllTables(schema string, tables []driver.Table) []string
func (*SchemaGrammar) CompileDropAllTypes ¶
func (r *SchemaGrammar) CompileDropAllTypes(schema string, types []driver.Type) []string
func (*SchemaGrammar) CompileDropAllViews ¶
func (r *SchemaGrammar) CompileDropAllViews(schema string, views []driver.View) []string
func (*SchemaGrammar) CompileDropColumn ¶
func (*SchemaGrammar) CompileDropForeign ¶
func (*SchemaGrammar) CompileDropFullText ¶
func (*SchemaGrammar) CompileDropIfExists ¶
func (r *SchemaGrammar) CompileDropIfExists(blueprint driver.Blueprint) string
func (*SchemaGrammar) CompileDropIndex ¶
func (*SchemaGrammar) CompileDropPrimary ¶
func (*SchemaGrammar) CompileDropUnique ¶
func (*SchemaGrammar) CompileForeign ¶
func (*SchemaGrammar) CompileForeignKeys ¶
func (r *SchemaGrammar) CompileForeignKeys(schema, table string) string
func (*SchemaGrammar) CompileFullText ¶
func (*SchemaGrammar) CompileInRandomOrder ¶
func (r *SchemaGrammar) CompileInRandomOrder(builder sq.SelectBuilder, conditions *driver.Conditions) sq.SelectBuilder
func (*SchemaGrammar) CompileIndex ¶
func (*SchemaGrammar) CompileIndexes ¶
func (r *SchemaGrammar) CompileIndexes(schema, table string) (string, error)
func (*SchemaGrammar) CompileJsonColumnsUpdate ¶
func (*SchemaGrammar) CompileJsonContains ¶
func (*SchemaGrammar) CompileJsonContainsKey ¶
func (r *SchemaGrammar) CompileJsonContainsKey(column string, isNot bool) string
func (*SchemaGrammar) CompileJsonLength ¶
func (r *SchemaGrammar) CompileJsonLength(column string) string
func (*SchemaGrammar) CompileJsonSelector ¶
func (r *SchemaGrammar) CompileJsonSelector(column string) string
func (*SchemaGrammar) CompileJsonValues ¶
func (r *SchemaGrammar) CompileJsonValues(args ...any) []any
func (*SchemaGrammar) CompileLockForUpdate ¶
func (r *SchemaGrammar) CompileLockForUpdate(builder sq.SelectBuilder, conditions *driver.Conditions) sq.SelectBuilder
func (*SchemaGrammar) CompileLockForUpdateForGorm ¶
func (r *SchemaGrammar) CompileLockForUpdateForGorm() any
func (*SchemaGrammar) CompilePlaceholderFormat ¶
func (r *SchemaGrammar) CompilePlaceholderFormat() driver.PlaceholderFormat
func (*SchemaGrammar) CompilePrimary ¶
func (*SchemaGrammar) CompilePrune ¶
func (r *SchemaGrammar) CompilePrune(_ string) string
func (*SchemaGrammar) CompileRandomOrderForGorm ¶
func (r *SchemaGrammar) CompileRandomOrderForGorm() string
func (*SchemaGrammar) CompileRename ¶
func (*SchemaGrammar) CompileRenameColumn ¶
func (*SchemaGrammar) CompileRenameIndex ¶
func (*SchemaGrammar) CompileSchemaBlueprint ¶
func (r *SchemaGrammar) CompileSchemaBlueprint(blueprint driver.Blueprint, catalog driver.SchemaCatalog) ([]driver.SchemaStatement, bool, error)
func (*SchemaGrammar) CompileSchemaCommand ¶
func (r *SchemaGrammar) CompileSchemaCommand(blueprint driver.Blueprint, command *driver.Command) ([]driver.SchemaStatement, bool, error)
func (*SchemaGrammar) CompileSchemaMetadata ¶
func (r *SchemaGrammar) CompileSchemaMetadata(query driver.SchemaMetadataQuery) (driver.SchemaStatement, error)
func (*SchemaGrammar) CompileSchemaOperation ¶
func (r *SchemaGrammar) CompileSchemaOperation(operation driver.SchemaOperation) ([]driver.SchemaStatement, error)
func (*SchemaGrammar) CompileSchemaStartingValues ¶
func (r *SchemaGrammar) CompileSchemaStartingValues(blueprint driver.Blueprint) ([]driver.SchemaStatement, error)
func (*SchemaGrammar) CompileSharedLock ¶
func (r *SchemaGrammar) CompileSharedLock(builder sq.SelectBuilder, conditions *driver.Conditions) sq.SelectBuilder
func (*SchemaGrammar) CompileSharedLockForGorm ¶
func (r *SchemaGrammar) CompileSharedLockForGorm() any
func (*SchemaGrammar) CompileTableComment ¶
func (*SchemaGrammar) CompileTables ¶
func (r *SchemaGrammar) CompileTables(_ string) string
func (*SchemaGrammar) CompileTypes ¶
func (r *SchemaGrammar) CompileTypes() string
func (*SchemaGrammar) CompileUnique ¶
func (*SchemaGrammar) CompileVersion ¶
func (r *SchemaGrammar) CompileVersion() string
func (*SchemaGrammar) CompileViews ¶
func (r *SchemaGrammar) CompileViews(database string) string
func (*SchemaGrammar) CurrentSchemas ¶
func (*SchemaGrammar) CurrentSchemas(string) []string
func (*SchemaGrammar) EscapeNames ¶
func (r *SchemaGrammar) EscapeNames(names []string) []string
func (*SchemaGrammar) ForeignKeyStateQuery ¶
func (*SchemaGrammar) ForeignKeyStateQuery() string
func (*SchemaGrammar) GetAttributeCommands ¶
func (r *SchemaGrammar) GetAttributeCommands() []string
func (*SchemaGrammar) ModifyDefault ¶
func (r *SchemaGrammar) ModifyDefault(_ driver.Blueprint, column driver.ColumnDefinition) string
func (*SchemaGrammar) ModifyGeneratedAs ¶
func (r *SchemaGrammar) ModifyGeneratedAs(_ driver.Blueprint, column driver.ColumnDefinition) string
func (*SchemaGrammar) ModifyGeneratedAsForChange ¶
func (r *SchemaGrammar) ModifyGeneratedAsForChange(_ driver.Blueprint, column driver.ColumnDefinition) string
func (*SchemaGrammar) ModifyIncrement ¶
func (r *SchemaGrammar) ModifyIncrement(blueprint driver.Blueprint, column driver.ColumnDefinition) string
func (*SchemaGrammar) ModifyNullable ¶
func (r *SchemaGrammar) ModifyNullable(_ driver.Blueprint, column driver.ColumnDefinition) string
func (*SchemaGrammar) ResolveCurrentSchemas ¶
func (r *SchemaGrammar) ResolveCurrentSchemas(_ driver.SchemaConnectionInfo, catalog driver.SchemaCatalog) ([]string, error)
ResolveCurrentSchemas asks the session to expand $user and quoted names and exclude schemas that do not exist or are not accessible to the current role.
func (*SchemaGrammar) SchemaExecutionPolicy ¶
func (r *SchemaGrammar) SchemaExecutionPolicy(blueprint driver.Blueprint) driver.SchemaExecutionPolicy
func (*SchemaGrammar) SchemaOperationPolicy ¶
func (*SchemaGrammar) SchemaOperationPolicy(operation driver.SchemaOperation) driver.SchemaExecutionPolicy
func (*SchemaGrammar) SetVersionResolver ¶
func (r *SchemaGrammar) SetVersionResolver(resolver func() (string, error))
func (*SchemaGrammar) TypeBigInteger ¶
func (r *SchemaGrammar) TypeBigInteger(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeBoolean ¶
func (r *SchemaGrammar) TypeBoolean(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeChar ¶
func (r *SchemaGrammar) TypeChar(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeDate ¶
func (r *SchemaGrammar) TypeDate(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeDateTime ¶
func (r *SchemaGrammar) TypeDateTime(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeDateTimeTz ¶
func (r *SchemaGrammar) TypeDateTimeTz(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeDecimal ¶
func (r *SchemaGrammar) TypeDecimal(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeDouble ¶
func (r *SchemaGrammar) TypeDouble(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeEnum ¶
func (r *SchemaGrammar) TypeEnum(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeFloat ¶
func (r *SchemaGrammar) TypeFloat(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeInteger ¶
func (r *SchemaGrammar) TypeInteger(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeJson ¶
func (r *SchemaGrammar) TypeJson(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeJsonb ¶
func (r *SchemaGrammar) TypeJsonb(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeLongText ¶
func (r *SchemaGrammar) TypeLongText(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeMediumInteger ¶
func (r *SchemaGrammar) TypeMediumInteger(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeMediumText ¶
func (r *SchemaGrammar) TypeMediumText(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeSmallInteger ¶
func (r *SchemaGrammar) TypeSmallInteger(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeString ¶
func (r *SchemaGrammar) TypeString(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeText ¶
func (r *SchemaGrammar) TypeText(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeTime ¶
func (r *SchemaGrammar) TypeTime(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeTimeTz ¶
func (r *SchemaGrammar) TypeTimeTz(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeTimestamp ¶
func (r *SchemaGrammar) TypeTimestamp(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeTimestampTz ¶
func (r *SchemaGrammar) TypeTimestampTz(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeTinyInteger ¶
func (r *SchemaGrammar) TypeTinyInteger(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeTinyText ¶
func (r *SchemaGrammar) TypeTinyText(column driver.ColumnDefinition) string
func (*SchemaGrammar) TypeUuid ¶
func (r *SchemaGrammar) TypeUuid(column driver.ColumnDefinition) string
type ServiceProvider ¶
type ServiceProvider struct{}
func (*ServiceProvider) Boot ¶
func (r *ServiceProvider) Boot(foundation.Application)
func (*ServiceProvider) Register ¶
func (r *ServiceProvider) Register(app foundation.Application)
func (*ServiceProvider) Relationship ¶
func (r *ServiceProvider) Relationship() binding.Relationship