Documentation
¶
Overview ¶
Package dialect defines SQL rendering contracts for database-specific implementations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindPlaceholders ¶ added in v0.3.2
BindPlaceholders rewrites generic positional placeholders into dialect-specific placeholders.
Types ¶
type Capabilities ¶
type Capabilities struct {
UUID bool
JSONB bool
ARRAY bool
ENUM bool
GeneratedColumns bool
MaterializedViews bool
PartialIndexes bool
ExpressionIndexes bool
Gin bool
Gist bool
IdentityColumns bool
CompositeKeys bool
CompositeIndexes bool
PreparedStatements bool
}
Capabilities describes features supported by a SQL dialect.
type Dialect ¶
type Dialect interface {
Name() string
QuoteIdent(string) string
Placeholder(int) string
Capabilities() Capabilities
ColumnDefinition(*schema.Column) (string, error)
RenderOperation(schema.Operation) (string, error)
RenderMigration(*schema.Diff) ([]string, error)
RenderSelect(table string, columns []string, distinct bool, joins []string, where []string, groupBy []string, having []string, orderBy []string, limit, offset *int) (string, error)
RenderInsert(table string, columns []string, returning []string) (string, error)
RenderUpdate(table string, set []string, where []string, returning []string) (string, error)
RenderDelete(table string, where []string, returning []string) (string, error)
}
Dialect renders SQL for a specific database flavor.
Click to show internal directories.
Click to hide internal directories.