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

mysql

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

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

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

README

MySQL

MySQL and MariaDB runtime driver for github.com/gradii/framework. This fork of goravel/mysql uses database/sql and github.com/go-sql-driver/mysql, with no GORM dependency.

Register &mysql.ServiceProvider{} with the application and select the driver through the connection's via callback:

import (
    "github.com/gradii/framework/contracts/database/driver"
    mysqlfacades "github.com/gradii/mysql/facades"
)

"mysql": map[string]any{
    "driver": "mysql", // "mariadb" explicitly selects MariaDB behavior
    "host": "127.0.0.1",
    "port": 3306,
    "database": "application",
    "username": "application",
    "password": "",
    "charset": "utf8mb4",
    "loc": "UTC",
    "prefix": "",
    "via": func() (driver.Driver, error) {
        return mysqlfacades.Mysql("mysql")
    },
},

The framework owns pools, transactions, reader/writer routing and cached server version discovery. The driver supplies connectors, query and schema grammars, metadata processors and MySQL/MariaDB compatibility behavior.

Reader and writer entries use []contracts.Config. Empty endpoint fields inherit the named connection's values. An explicit Connector wins over a DSN; an explicit DSN wins over individual connection fields and preserves native TLS, session and other options. Generated connections enable parseTime and multiStatements. Connector validation occurs when the framework opens the endpoint, not in Pool().

loc falls back to app.timezone, then UTC. It controls Go time parsing and representation, independently of MySQL's session time_zone; set session options through the native DSN when needed. Connection charset is retained independently of schema table/column charset and collation.

Model table and column mappings must be explicit. prefix remains supported; singular, name_replacer and no_lower_case are removed. See NAMING_STRATEGY.md for the mapping constraints. Docker helpers and automatic installation tooling are outside this runtime module. The legacy Driver.Docker() method returns an unsupported error.

Development

This refactor requires the matching framework changes. The framework dependency must be updated to a published revision containing the new driver contracts before release. To work on sibling mysql and goravel-framework checkouts locally:

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

Workspace files are ignored. Release dependencies do not contain machine-specific paths. Unit tests do not create Docker containers. Optional live connector tests use GRADII_TEST_MYSQL_DSN (or GORAVEL_TEST_MYSQL_DSN) against an existing disposable test database. For example, with credentials supplied by your test environment:

go test -run TestConnectorIntegrationCharsetAndTimezone -v .
go test -run TestFrameworkIntegration -v .

The live connector test verifies UTF-8 text and datetime round trips in UTC and Asia/Shanghai, plus independent native DSN charset and session timezone settings. It creates connection-local temporary tables and closes its pools afterward. The framework integration test uses a unique table prefix, removes its tables on completion, and verifies DB/ORM CRUD, JSON predicates, explicit model mappings, single-connection transactions, schema metadata and foreign-key session cleanup.

Documentation

Index

Constants

View Source
const (
	Binding = "gradii.mysql"
	Name    = "MySQL"
)

Variables

Functions

func NewConnector

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

NewConnector validates an endpoint without opening a connection. Explicit connectors and DSNs retain their native options, including TLS/session settings.

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 {
	// contains filtered or unexported fields
}

Dialect supplies connection-specific MySQL or MariaDB runtime components.

func NewDialect

func NewDialect(name ...string) *Dialect

func (*Dialect) Escape

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

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

func (*Dialect) Name

func (d *Dialect) Name() string

func (*Dialect) NewConnector

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

func (*Dialect) NewProcessor

func (d *Dialect) NewProcessor() contractsquery.Processor

func (*Dialect) NewQueryGrammar

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

func (*Dialect) ServerVersionSQL

func (d *Dialect) ServerVersionSQL() string

type Grammar

type Grammar = SchemaGrammar

Grammar is retained for existing drivers using the legacy constructor.

type MariaDBQueryGrammar

type MariaDBQueryGrammar struct{ *QueryGrammar }

MariaDBQueryGrammar preserves MariaDB's JSON casts, window limits, and lateral-join restriction.

func NewMariaDBQueryGrammar

func NewMariaDBQueryGrammar(prefix string, serverVersion ...func() (string, error)) *MariaDBQueryGrammar

func (*MariaDBQueryGrammar) CompileJoinLateral

func (g *MariaDBQueryGrammar) CompileJoinLateral(join core.Join, expression string) string

func (*MariaDBQueryGrammar) UseLegacyGroupLimit

func (g *MariaDBQueryGrammar) UseLegacyGroupLimit(b core.Query) bool

type MariaDBQueryProcessor

type MariaDBQueryProcessor struct{ QueryProcessor }

MariaDBQueryProcessor inherits MySQL's insert-ID processing, as in Laravel.

func NewMariaDBQueryProcessor

func NewMariaDBQueryProcessor() *MariaDBQueryProcessor

type Mysql

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

func NewMysql

func NewMysql(config config.Config, _ log.Log, _ process.Process, connection string) *Mysql

NewMysql resolves a named connection. The log and process arguments are kept for source compatibility; pool ownership belongs to the framework.

func (*Mysql) Dialect

func (r *Mysql) Dialect() contractsdriver.Dialect

func (*Mysql) Docker

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

Docker is the compatibility entry point required by the legacy Driver contract.

func (*Mysql) Grammar

func (r *Mysql) Grammar() contractsdriver.Grammar

func (*Mysql) Pool

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

Pool only normalizes configuration. Connector validation is deferred to the error-returning dialect factory when the framework opens each endpoint.

func (*Mysql) Processor

func (r *Mysql) Processor() contractsdriver.Processor

func (*Mysql) SetServerVersion

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

SetServerVersion receives the framework's cached managed-writer resolver.

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
	// contains filtered or unexported fields
}

QueryGrammar mirrors Illuminate\Database\Query\Grammars\MySqlGrammar. Only the methods whose SQL differs from the base are declared here.

func NewQueryGrammar

func NewQueryGrammar(prefix string, serverVersion ...func() (string, error)) *QueryGrammar

NewQueryGrammar creates the MySQL grammar, which quotes identifiers with backticks.

func (*QueryGrammar) CompileDelete

func (g *QueryGrammar) CompileDelete(b core.Query) string

func (*QueryGrammar) CompileDeleteWithoutJoins

func (g *QueryGrammar) CompileDeleteWithoutJoins(b core.Query, table string, where string) string

CompileDeleteWithoutJoins mirrors MySqlGrammar::compileDeleteWithoutJoins(): order by and limit.

func (*QueryGrammar) CompileGroupLimit

func (g *QueryGrammar) CompileGroupLimit(b core.Query) string

CompileGroupLimit mirrors MySqlGrammar::compileGroupLimit().

func (*QueryGrammar) CompileIndexHint

func (g *QueryGrammar) CompileIndexHint(b core.Query, hint *core.IndexHint) string

CompileIndexHint mirrors MySqlGrammar::compileIndexHint().

func (*QueryGrammar) CompileInsert

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

CompileInsert mirrors MySqlGrammar::compileInsert(): an empty insert becomes a default row.

func (*QueryGrammar) CompileInsertOrIgnore

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

CompileInsertOrIgnore mirrors MySqlGrammar::compileInsertOrIgnore().

func (*QueryGrammar) CompileInsertOrIgnoreUsing

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

CompileInsertOrIgnoreUsing mirrors MySqlGrammar::compileInsertOrIgnoreUsing().

func (*QueryGrammar) CompileInsertUsing

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

func (*QueryGrammar) CompileJoinLateral

func (g *QueryGrammar) CompileJoinLateral(join core.Join, expression string) string

CompileJoinLateral mirrors MySqlGrammar::compileJoinLateral().

func (*QueryGrammar) CompileJoins

func (g *QueryGrammar) CompileJoins(b core.Query, joins []core.Join) string

The MySQL driver can connect to MariaDB. Detect its lateral-join limitation from the connection version even when the configured driver name is "mysql".

func (*QueryGrammar) CompileJsonContains

func (g *QueryGrammar) CompileJsonContains(column string, value string) string

CompileJsonContains mirrors MySqlGrammar::compileJsonContains().

func (*QueryGrammar) CompileJsonContainsKey

func (g *QueryGrammar) CompileJsonContainsKey(column string) string

CompileJsonContainsKey mirrors MySqlGrammar::compileJsonContainsKey().

func (*QueryGrammar) CompileJsonLength

func (g *QueryGrammar) CompileJsonLength(column string, operator string, value string) string

CompileJsonLength mirrors MySqlGrammar::compileJsonLength().

func (*QueryGrammar) CompileJsonOverlaps

func (g *QueryGrammar) CompileJsonOverlaps(column string, value string) string

CompileJsonOverlaps mirrors MySqlGrammar::compileJsonOverlaps().

func (*QueryGrammar) CompileJsonUpdateColumn

func (g *QueryGrammar) CompileJsonUpdateColumn(key string, value any) string

CompileJsonUpdateColumn mirrors MySqlGrammar::compileJsonUpdateColumn().

func (*QueryGrammar) CompileJsonValueCast

func (g *QueryGrammar) CompileJsonValueCast(value string) string

CompileJsonValueCast mirrors MySqlGrammar::compileJsonValueCast().

func (*QueryGrammar) CompileLegacyGroupLimit

func (g *QueryGrammar) CompileLegacyGroupLimit(b core.Query) string

CompileLegacyGroupLimit mirrors MySqlGrammar::compileLegacyGroupLimit().

func (*QueryGrammar) CompileLock

func (g *QueryGrammar) CompileLock(b core.Query, value any) string

CompileLock mirrors MySqlGrammar::compileLock().

func (*QueryGrammar) CompileRandom

func (g *QueryGrammar) CompileRandom(seed any) string

CompileRandom mirrors MySqlGrammar::compileRandom().

func (*QueryGrammar) CompileSelect

func (g *QueryGrammar) CompileSelect(b core.Query) string

func (*QueryGrammar) CompileTruncate

func (g *QueryGrammar) CompileTruncate(b core.Query) []core.Statement

func (*QueryGrammar) CompileUpdate

func (g *QueryGrammar) CompileUpdate(b core.Query, values core.UpdateValues) string

func (*QueryGrammar) CompileUpdateColumns

func (g *QueryGrammar) CompileUpdateColumns(b core.Query, values core.UpdateValues) string

CompileUpdateColumns mirrors MySqlGrammar::compileUpdateColumns().

func (*QueryGrammar) CompileUpdateWithoutJoins

func (g *QueryGrammar) CompileUpdateWithoutJoins(b core.Query, table string, columns string, where string) string

CompileUpdateWithoutJoins mirrors MySqlGrammar::compileUpdateWithoutJoins(): order by and limit.

func (*QueryGrammar) CompileUpsert

func (g *QueryGrammar) CompileUpsert(b core.Query, values []map[string]any, uniqueBy []string, update []core.UpsertUpdate) string

CompileUpsert mirrors MySqlGrammar::compileUpsert(): on duplicate key update.

When the connection enables use_upsert_alias, the insert carries "as laravel_upsert_alias" and the copied columns read back through that alias instead of values(). An update entry that binds its own value (a string key in Laravel's $update) still compiles as "col = ?"; the alias only changes the value-copying form, exactly as Laravel's numeric-key branch decides.

func (*QueryGrammar) GetOperators

func (g *QueryGrammar) GetOperators() []string

GetOperators mirrors MySqlGrammar::$operators: "sounds like" is the one clause operator this dialect adds beyond the base set. Builder::invalidOperator() reads it back through getOperators(), so without it our Builder treats "sounds like" as unknown and shifts it into the value slot.

func (*QueryGrammar) PrepareBindingsForUpdate

func (g *QueryGrammar) PrepareBindingsForUpdate(bindings map[string][]any, values core.UpdateValues) []any

PrepareBindingsForUpdate mirrors MySqlGrammar::prepareBindingsForUpdate(): a JSON selector bound to a bool compiles to an inline true/false literal, so its binding is dropped; every array value is json-encoded. The rest keeps the base ordering.

func (*QueryGrammar) SetEscaper

func (g *QueryGrammar) SetEscaper(escape func(any, bool) string)

SetEscaper retains connection-specific escaping when a compilation selects MariaDB behavior.

func (*QueryGrammar) SetServerVersion

func (g *QueryGrammar) SetServerVersion(resolve func() (string, error))

SetServerVersion supplies the connection-owned, cached version resolver. It never opens a pool.

func (*QueryGrammar) UseLegacyGroupLimit

func (g *QueryGrammar) UseLegacyGroupLimit(b core.Query) bool

UseLegacyGroupLimit follows the connection's server version, as in Laravel. SQL-only builders without a connection retain the modern compilation path.

func (*QueryGrammar) WhereFullText

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

WhereFullText mirrors MySqlGrammar::whereFullText().

func (*QueryGrammar) WhereLike

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

WhereLike mirrors MySqlGrammar::whereLike().

func (*QueryGrammar) WhereNotNull

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

WhereNotNull mirrors MySqlGrammar::whereNotNull().

func (*QueryGrammar) WhereNull

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

WhereNull mirrors MySqlGrammar::whereNull().

func (*QueryGrammar) WrapJsonBooleanSelector

func (g *QueryGrammar) WrapJsonBooleanSelector(value string) string

WrapJsonBooleanSelector mirrors MySqlGrammar::wrapJsonBooleanSelector().

func (*QueryGrammar) WrapJsonSelector

func (g *QueryGrammar) WrapJsonSelector(value string) string

WrapJsonSelector mirrors MySqlGrammar::wrapJsonSelector().

type QueryProcessor

type QueryProcessor struct{ processors.BaseProcessor }

QueryProcessor uses the ID recorded by the insert operation, matching MySqlProcessor in Laravel. Go's sql.Result supplies the connection-local ID that Laravel's MySqlConnection records.

func NewQueryProcessor

func NewQueryProcessor() *QueryProcessor

func (*QueryProcessor) ProcessColumns

func (p *QueryProcessor) ProcessColumns(results []contractsquery.Row, sql ...string) []contractsquery.Row

ProcessColumns ports MySqlProcessor::processColumns, including generated-column metadata.

func (*QueryProcessor) ProcessForeignKeys

func (p *QueryProcessor) ProcessForeignKeys(results []contractsquery.Row) []contractsquery.Row

func (*QueryProcessor) ProcessIndexes

func (p *QueryProcessor) ProcessIndexes(results []contractsquery.Row) []contractsquery.Row

type SchemaGrammar

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

func NewGrammar

func NewGrammar(database, prefix, version, name string) *SchemaGrammar

func NewSchemaGrammar

func NewSchemaGrammar(database, prefix, version, name 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(_, table string) (string, error)

func (*SchemaGrammar) CompileComment

func (r *SchemaGrammar) CompileComment(_ driver.Blueprint, _ *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) CompileDisableForeignKeyConstraints

func (r *SchemaGrammar) CompileDisableForeignKeyConstraints() string

func (*SchemaGrammar) CompileDrop

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

func (*SchemaGrammar) CompileDropAllDomains

func (r *SchemaGrammar) CompileDropAllDomains(_ []string) string

func (*SchemaGrammar) CompileDropAllTables

func (r *SchemaGrammar) CompileDropAllTables(_ string, tables []driver.Table) []string

func (*SchemaGrammar) CompileDropAllTypes

func (r *SchemaGrammar) CompileDropAllTypes(_ string, _ []driver.Type) []string

func (*SchemaGrammar) CompileDropAllViews

func (r *SchemaGrammar) CompileDropAllViews(_ 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, _ *driver.Command) string

func (*SchemaGrammar) CompileDropUnique

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

func (*SchemaGrammar) CompileEnableForeignKeyConstraints

func (r *SchemaGrammar) CompileEnableForeignKeyConstraints() string

func (*SchemaGrammar) CompileForeign

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

func (*SchemaGrammar) CompileForeignKeys

func (r *SchemaGrammar) CompileForeignKeys(_, 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(_, 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) 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) 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, columns []driver.Column) (string, error)

func (*SchemaGrammar) CompileRenameIndex

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

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

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

func (*SchemaGrammar) CompileTables

func (r *SchemaGrammar) CompileTables(database 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 (r *SchemaGrammar) CurrentSchemas(database string) []string

func (*SchemaGrammar) ForeignKeyStateQuery

func (r *SchemaGrammar) ForeignKeyStateQuery() string

func (*SchemaGrammar) GetAttributeCommands

func (r *SchemaGrammar) GetAttributeCommands() []string

func (*SchemaGrammar) ModifyAfter

func (r *SchemaGrammar) ModifyAfter(_ driver.Blueprint, column driver.ColumnDefinition) string

func (*SchemaGrammar) ModifyComment

func (r *SchemaGrammar) ModifyComment(_ driver.Blueprint, column driver.ColumnDefinition) string

func (*SchemaGrammar) ModifyDefault

func (r *SchemaGrammar) ModifyDefault(_ driver.Blueprint, column driver.ColumnDefinition) string

func (*SchemaGrammar) ModifyFirst

func (r *SchemaGrammar) ModifyFirst(_ 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) ModifyOnUpdate

func (r *SchemaGrammar) ModifyOnUpdate(_ driver.Blueprint, column driver.ColumnDefinition) string

func (*SchemaGrammar) ModifyUnsigned

func (r *SchemaGrammar) ModifyUnsigned(_ driver.Blueprint, column driver.ColumnDefinition) string

func (*SchemaGrammar) ResolveCurrentSchemas

func (*SchemaGrammar) ResolveCurrentSchemas(_ driver.SchemaConnectionInfo, catalog driver.SchemaCatalog) ([]string, error)

Connection settings can come entirely from a Connector or DSN. The active session, rather than a possibly empty or overridden config field, owns scope.

func (*SchemaGrammar) SchemaOperationPolicy

func (r *SchemaGrammar) SchemaOperationPolicy(operation driver.SchemaOperation) driver.SchemaExecutionPolicy

func (*SchemaGrammar) SetTableDefaults

func (r *SchemaGrammar) SetTableDefaults(charset, collation string)

SetTableDefaults supplies connection defaults; explicit blueprint options win.

func (*SchemaGrammar) SetVersionResolver

func (r *SchemaGrammar) SetVersionResolver(resolve func() (string, error))

func (*SchemaGrammar) TypeBigInteger

func (r *SchemaGrammar) TypeBigInteger(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeBoolean

func (r *SchemaGrammar) TypeBoolean(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeChar

func (r *SchemaGrammar) TypeChar(column driver.ColumnDefinition) string

func (*SchemaGrammar) TypeDate

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(_ 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(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeJson

func (*SchemaGrammar) TypeJsonb

func (r *SchemaGrammar) TypeJsonb(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeLongText

func (r *SchemaGrammar) TypeLongText(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeMediumInteger

func (r *SchemaGrammar) TypeMediumInteger(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeMediumText

func (r *SchemaGrammar) TypeMediumText(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeSmallInteger

func (r *SchemaGrammar) TypeSmallInteger(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeString

func (r *SchemaGrammar) TypeString(column driver.ColumnDefinition) string

func (*SchemaGrammar) TypeText

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(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeTinyText

func (r *SchemaGrammar) TypeTinyText(_ driver.ColumnDefinition) string

func (*SchemaGrammar) TypeUuid

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