Documentation
¶
Index ¶
Constants ¶
View Source
const ( SqliteIndex = iota MysqlIndex PostgresIndex PgxIndex )
Variables ¶
AllDialects lists all currently-supported dialects.
Functions ¶
This section is empty.
Types ¶
type Dialect ¶
type Dialect interface {
// Index returns a consistent ID for this dialect, regardless of other settings.
Index() int
// String returns the name of this dialect.
String() string
// Alias is an alternative name for this dialect.
Alias() string
// Quoter is the tool used for quoting identifiers.
Quoter() quote.Quoter
// WithQuoter returns a modified Dialect with a given quoter.
WithQuoter(q quote.Quoter) Dialect
FieldAsColumn(field *schema.Field) string
TruncateDDL(tableName string, force bool) []string
CreateTableSettings() string
InsertHasReturningPhrase() bool
ShowTables() string
ReplacePlaceholders(sql string, args []interface{}) string
Placeholders(n int) string
HasNumberedPlaceholders() bool
}
Dialect is an abstraction of a type of database.
var Mysql Dialect = mysql{/* contains filtered or unexported fields */}
var Pgx Dialect = pgx{}
var Postgres Dialect = postgres{/* contains filtered or unexported fields */}
var Sqlite Dialect = sqlite{/* contains filtered or unexported fields */}
func PickDialect ¶
PickDialect finds a dialect that matches by name, ignoring letter case. It returns nil if not found.
type StringWriter ¶
StringWriter is an interface that wraps the WriteString method. Note that bytes.Buffer happens to implement this interface.
Click to show internal directories.
Click to hide internal directories.