Documentation
¶
Overview ¶
Package dialect abstracts per-RDBMS placeholder generation and literal formatting (for the /*^ */ literal directive). bisql abstracts only this; it does not handle SQL dialects themselves.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // MySQL uses ? placeholders. MySQL = Dialect{/* contains filtered or unexported fields */} // SQLite uses ? placeholders (positional), like MySQL. SQLite = Dialect{/* contains filtered or unexported fields */} // PostgreSQL uses $1, $2, ... placeholders and renders array literals as '{...}'. PostgreSQL = Dialect{ // contains filtered or unexported fields } // Oracle uses :1, :2, ... placeholders. Oracle = Dialect{/* contains filtered or unexported fields */} // SQLServer uses @p1, @p2, ... placeholders. SQLServer = Dialect{/* contains filtered or unexported fields */} )
Functions ¶
func FormatLiteral ¶
FormatLiteral is the default literal formatter: nil -> null, strings are single-quoted with ” escaping, booleans and numbers render bare. It is deliberately conservative; dialects with different quoting rules can supply their own.
Types ¶
type Dialect ¶
type Dialect struct {
// contains filtered or unexported fields
}
Dialect carries a name, its placeholder generator, and its literal formatter.
func (Dialect) Literal ¶
Literal returns the literal formatter, falling back to FormatLiteral when unset.
func (Dialect) Placeholder ¶
func (d Dialect) Placeholder() Placeholder
Placeholder returns the placeholder generator.
type Placeholder ¶
Placeholder generates a placeholder. index is the 1-based sequential number; name is the bind name (empty if anonymous).