Help us shape the future of Go! Take the 2026 Go Developer Survey

postgres

package module
v1.20.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 37 Imported by: 0

README

PostgreSQL

PostgreSQL runtime driver for github.com/gradii/framework, forked from goravel/postgres. The runtime uses database/sql and pgx, with no GORM dependency.

Register &postgres.ServiceProvider{} and configure a connection's via callback to return facades.Postgres("postgres") from github.com/gradii/postgres/facades. The callback retains the framework's func() (driver.Driver, error) contract. The framework owns pools, transactions and routing; this module supplies connectors, query and schema grammars, result processors and PostgreSQL literal rendering.

Connection fields include host, port, database, username, password, schema (the PostgreSQL search path), search_path, sslmode, timezone, prefix, and dsn. Read/write entries use []contracts.Config and inherit empty fields from the named connection. An explicit connector wins over a DSN; an explicit native DSN preserves its TLS, search-path, timezone and other connection options. Both generated and explicit DSNs use pgx simple protocol without a cached plan, preserving migration compatibility when result shapes change. The framework binds JSON model fields marked type:json/jsonb as text after invoking their Valuer. Raw DB parameters retain pgx's native behavior: bytes represent bytea, so use a JSON Valuer returning string or the framework's JSON types when no model metadata is available. Pool() does not perform connector validation or network I/O.

Timezone falls back to app.timezone, then UTC. Schema defaults to public for generated connections. search_path accepts server syntax or a list of literal schema names, taking precedence over the top-level schema alias. Current schema listing always uses the active session, including DSN/Connector-only connections and $user expansion. prefix remains supported; singular, name_replacer, and no_lower_case are removed. Model table and column names must be explicit.

Stored generated columns require PostgreSQL 12; virtual generated columns require PostgreSQL 18. Older metadata queries omit catalog fields absent from the server. PostGIS geometry/geography and pgvector SQL compilation preserve their extension types; running those statements requires the corresponding server extension.

Development and tests

Release requires a matching published framework revision containing the new driver contracts. For sibling checkouts, use an ignored local workspace:

go work init . ../goravel-framework ../mysql
go work edit -replace=github.com/gradii/framework@v1.20.0-alpha.0=../goravel-framework
go test -race ./...
go tool mockery

Set GRADII_TEST_POSTGRES_DSN (or GORAVEL_TEST_POSTGRES_DSN) to an existing test database to run go test -run TestFrameworkIntegration -v .. The test creates and removes a unique schema and verifies DB/ORM CRUD, JSONB, explicit mappings, RETURNING IDs, single-connection transactions, schema metadata and transactional DDL. Live integration was verified against PostgreSQL 18.3. Earlier generated-column boundaries and PostGIS/pgvector types have compilation tests, without live extension or historical-server verification.

Upstream test cases have been ported to the new query/schema/connector APIs. Database-fixture lifecycle coverage lives in the framework integration module. No old implementation or GORM compatibility module is retained. Docker and automatic installation tooling are outside the runtime module; the compatibility Driver.Docker() method returns an unsupported error.

Documentation

Index

Constants

View Source
const (
	Binding = "gradii.postgres"
	Name    = "PostgreSQL"
)

Variables

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.

func NewConnector

func NewConnector(endpoint database.Config) (driver.Connector, error)

NewConnector validates settings without opening a pool or contacting PostgreSQL.

Types

type Config

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

func NewConfig

func NewConfig(config config.Config, connection string) *Config

func (*Config) Config

func (r *Config) Config() config.Config

func (*Config) Connection

func (r *Config) Connection() string

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

func (d *Dialect) Escape(value any, binary bool) (string, error)

Escape formats a PostgreSQL scalar literal for SQL previews. Query execution uses bound parameters, independently of this presentation-only operation.

func (*Dialect) Name

func (*Dialect) Name() string

func (*Dialect) NewConnector

func (*Dialect) NewConnector(endpoint database.Config) (driver.Connector, error)

func (*Dialect) NewProcessor

func (*Dialect) NewProcessor() contractsquery.Processor

func (*Dialect) NewQueryGrammar

func (*Dialect) NewQueryGrammar(options contractsdriver.GrammarOptions) contractsquery.Grammar

func (*Dialect) ServerVersionSQL

func (*Dialect) ServerVersionSQL() string

type Grammar

type Grammar = SchemaGrammar

type Postgres

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

func NewPostgres

func NewPostgres(config config.Config, _ log.Log, _ process.Process, connection string) *Postgres

NewPostgres keeps the legacy constructor while the framework owns SQL pools.

func (*Postgres) Dialect

func (r *Postgres) Dialect() driver.Dialect

func (*Postgres) Docker

func (r *Postgres) Docker() (docker.DatabaseDriver, error)

func (*Postgres) Grammar

func (r *Postgres) Grammar() driver.Grammar

func (*Postgres) Pool

func (r *Postgres) Pool() database.Pool

func (*Postgres) Processor

func (r *Postgres) Processor() driver.Processor

func (*Postgres) SetServerVersion

func (r *Postgres) SetServerVersion(resolver func() (string, error))

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 (r Processor) ProcessColumns(values []driver.DBColumn) []driver.Column

func (Processor) ProcessForeignKeys

func (r Processor) ProcessForeignKeys(values []driver.DBForeignKey) []driver.ForeignKey

func (Processor) ProcessIndexes

func (r Processor) ProcessIndexes(values []driver.DBIndex) []driver.Index

func (Processor) ProcessTypes

func (r Processor) ProcessTypes(values []driver.Type) []driver.Type

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

func (g *QueryGrammar) CompileHaving(b core.Query, having core.Having) string

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

func (g *QueryGrammar) CompileInsertOrIgnore(b core.Query, values []map[string]any) string

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

func (g *QueryGrammar) CompileInsertOrIgnoreUsing(b core.Query, columns []any, sql string) string

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

func (g *QueryGrammar) WhereBasic(b core.Query, where core.Where) string

WhereBasic mirrors PostgresGrammar::whereBasic(): a like comparison casts the column to text.

func (*QueryGrammar) WhereBitwise

func (g *QueryGrammar) WhereBitwise(b core.Query, where core.Where) string

WhereBitwise mirrors PostgresGrammar::whereBitwise().

func (*QueryGrammar) WhereDate

func (g *QueryGrammar) WhereDate(b core.Query, where core.Where) string

WhereDate mirrors PostgresGrammar::whereDate().

func (*QueryGrammar) WhereDay

func (g *QueryGrammar) WhereDay(b core.Query, where core.Where) string

WhereDay mirrors PostgresGrammar::whereDay().

func (*QueryGrammar) WhereFullText

func (g *QueryGrammar) WhereFullText(b core.Query, where core.Where) string

WhereFullText mirrors PostgresGrammar::whereFullText().

func (*QueryGrammar) WhereLike

func (g *QueryGrammar) WhereLike(b core.Query, where core.Where) string

WhereLike mirrors PostgresGrammar::whereLike(): the default match is case insensitive.

func (*QueryGrammar) WhereMonth

func (g *QueryGrammar) WhereMonth(b core.Query, where core.Where) string

WhereMonth mirrors PostgresGrammar::whereMonth().

func (*QueryGrammar) WhereTime

func (g *QueryGrammar) WhereTime(b core.Query, where core.Where) string

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) WhereYear

func (g *QueryGrammar) WhereYear(b core.Query, where core.Where) string

WhereYear mirrors PostgresGrammar::whereYear().

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 (r *SchemaGrammar) CompileAdd(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileChange

func (r *SchemaGrammar) CompileChange(blueprint driver.Blueprint, command *driver.Command) []string

func (*SchemaGrammar) CompileColumns

func (r *SchemaGrammar) CompileColumns(schema, table string) (string, error)

func (*SchemaGrammar) CompileComment

func (r *SchemaGrammar) CompileComment(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileCreate

func (r *SchemaGrammar) CompileCreate(blueprint driver.Blueprint) string

func (*SchemaGrammar) CompileDefault

func (r *SchemaGrammar) CompileDefault(_ driver.Blueprint, _ *driver.Command) string

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 (r *SchemaGrammar) CompileDropColumn(blueprint driver.Blueprint, command *driver.Command) []string

func (*SchemaGrammar) CompileDropForeign

func (r *SchemaGrammar) CompileDropForeign(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileDropFullText

func (r *SchemaGrammar) CompileDropFullText(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileDropIfExists

func (r *SchemaGrammar) CompileDropIfExists(blueprint driver.Blueprint) string

func (*SchemaGrammar) CompileDropIndex

func (r *SchemaGrammar) CompileDropIndex(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileDropPrimary

func (r *SchemaGrammar) CompileDropPrimary(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileDropUnique

func (r *SchemaGrammar) CompileDropUnique(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileForeign

func (r *SchemaGrammar) CompileForeign(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileForeignKeys

func (r *SchemaGrammar) CompileForeignKeys(schema, table string) string

func (*SchemaGrammar) CompileFullText

func (r *SchemaGrammar) CompileFullText(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileInRandomOrder

func (r *SchemaGrammar) CompileInRandomOrder(builder sq.SelectBuilder, conditions *driver.Conditions) sq.SelectBuilder

func (*SchemaGrammar) CompileIndex

func (r *SchemaGrammar) CompileIndex(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileIndexes

func (r *SchemaGrammar) CompileIndexes(schema, table string) (string, error)

func (*SchemaGrammar) CompileJsonColumnsUpdate

func (r *SchemaGrammar) CompileJsonColumnsUpdate(values map[string]any) (map[string]any, error)

func (*SchemaGrammar) CompileJsonContains

func (r *SchemaGrammar) CompileJsonContains(column string, value any, isNot bool) (string, []any, error)

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 (r *SchemaGrammar) CompilePrimary(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompilePrune

func (r *SchemaGrammar) CompilePrune(_ string) string

func (*SchemaGrammar) CompileRandomOrderForGorm

func (r *SchemaGrammar) CompileRandomOrderForGorm() string

func (*SchemaGrammar) CompileRename

func (r *SchemaGrammar) CompileRename(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileRenameColumn

func (r *SchemaGrammar) CompileRenameColumn(blueprint driver.Blueprint, command *driver.Command, _ []driver.Column) (string, error)

func (*SchemaGrammar) CompileRenameIndex

func (r *SchemaGrammar) CompileRenameIndex(blueprint driver.Blueprint, command *driver.Command, _ []driver.Index) []string

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 (r *SchemaGrammar) CompileTableComment(blueprint driver.Blueprint, command *driver.Command) string

func (*SchemaGrammar) CompileTables

func (r *SchemaGrammar) CompileTables(_ string) string

func (*SchemaGrammar) CompileTypes

func (r *SchemaGrammar) CompileTypes() string

func (*SchemaGrammar) CompileUnique

func (r *SchemaGrammar) CompileUnique(blueprint driver.Blueprint, command *driver.Command) string

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 (*ServiceProvider) Register

func (r *ServiceProvider) Register(app foundation.Application)

func (*ServiceProvider) Relationship

func (r *ServiceProvider) Relationship() binding.Relationship

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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