Documentation ¶
Overview ¶
Package dialect contains functionality for SQL dialects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultOps ¶
DefaultOps returns a default map of SLQ operator (e.g. "==" or "!=") to its SQL rendering. The returned map is a copy and can be safely modified by the caller.
Types ¶
type Dialect ¶
type Dialect struct { // Type is the dialect's driver source type. Type source.Type `json:"type"` // Placeholders returns a string a SQL placeholders string. // For example "(?, ?, ?)" or "($1, $2, $3), ($4, $5, $6)". Placeholders func(numCols, numRows int) string // IdentQuote is the identifier quote rune. Most often this is // double-quote, e.g. SELECT * FROM "my_table", but can be other // values such as backtick, e.g. SELECT * FROM `my_table`. // // Arguably, this field should be deprecated. There's probably // no reason not to always use Enquote. IdentQuote rune `json:"quote"` // Enquote is a function that quotes and escapes an // identifier (such as a table or column name). Enquote func(string) string // IntBool is true if BOOLEAN is handled as an INT by the DB driver. IntBool bool `json:"int_bool"` // MaxBatchValues is the maximum number of values in a batch insert. MaxBatchValues int // Ops is a map of SLQ operator (e.g. "==" or "!=") to // its default SQL rendering. Ops map[string]string }
Dialect holds driver-specific SQL dialect values and functions.
Click to show internal directories.
Click to hide internal directories.