Documentation ¶
Overview ¶
Package quote augments SQL strings by quoting identifiers according to three common variants: back-ticks used by MySQL, double-quotes used in ANSI SQL (PostgreSQL etc), or no quotes at all.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Quoter ¶
type Quoter interface { Quote(identifier string) string QuoteN(identifiers []string) []string QuoteW(w io.StringWriter, identifier string) (n int, err error) }
Quoter wraps identifiers in quote marks. Compound identifiers (i.e. those with an alias prefix) are handled according to SQL grammar.
var ( // AnsiQuoter wraps identifiers in double quotes. AnsiQuoter Quoter = ansiQuoter // MySqlQuoter wraps identifiers in back-ticks. MySqlQuoter Quoter = mySqlQuoter // NoQuoter leaves identifiers unquoted. NoQuoter Quoter = noQuoter // DefaultQuoter is used by default. // // Change this to affect the default setting for every SQL construction function. DefaultQuoter = AnsiQuoter )
func PickQuoter ¶ added in v0.8.0
PickQuoter picks a quoter based on the names "ansi", "mysql" or "none". If none match, then nil is returned.
Click to show internal directories.
Click to hide internal directories.