dialect

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRequiresTableRebuild = errors.New("dialect: altering this column requires a table rebuild")

Functions

This section is empty.

Types

type ColumnMeta

type ColumnMeta struct {
	Name       string
	SQLType    string
	Nullable   bool
	PrimaryKey bool
}

type ColumnSpec

type ColumnSpec struct {
	PrimaryKey    bool
	AutoIncrement bool
	NotNull       bool
	Unique        bool
	HasDefault    bool
	Default       string
	SQLType       string
}

type DDL

type DDL interface {
	ColumnDefinition(goType reflect.Type, spec ColumnSpec) (string, error)
	InlinesPrimaryKey(spec ColumnSpec) bool
	AlterColumnSQL(table, column string, goType reflect.Type, spec ColumnSpec) (string, error)
	DropIndexSQL(table, index string) string
	RenameIndexSQL(table, oldName, newName string) (string, error)
	HasTableSQL(table string) (string, []any)
	HasColumnSQL(table, column string) (string, []any)
	HasIndexSQL(table, name string) (string, []any)
	HasConstraintSQL(table, name string) (string, []any)
	GetTablesSQL() (string, []any)
	ColumnTypesSQL(table string) (string, []any)
	CurrentDatabaseSQL() string
}

type Dialect

type Dialect interface {
	Name() string

	QuoteIdent(name string) string

	Placeholder(n int) string

	SupportsILike() bool

	SupportsRowLocking() bool

	SupportsReturning() bool

	SupportsOnConflict() bool

	SupportsSavepoints() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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