Help us shape the future of Go! Take the 2026 Go Developer Survey

format

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect interface {
	// QuoteIdent returns a quoted identifier if it needs quoting
	// (e.g., reserved words, mixed case identifiers)
	QuoteIdent(s string) string

	// TypeName returns the SQL type name for the given namespace and name.
	// This handles dialect-specific type name mappings (e.g., pg_catalog.int4 -> integer)
	TypeName(ns, name string) string

	// Param returns the placeholder for the parameter with this number.
	// numbered reports that the author wrote the number out (SQLite's ?2,
	// where a bare ? takes the next index), so engines with both forms can
	// keep the one that was written.
	// PostgreSQL uses $1, $2, etc. MySQL uses ?
	Param(n int, numbered bool) string

	// Cast formats a type cast expression.
	// PostgreSQL uses expr::type, MySQL uses CAST(expr AS type)
	Cast(arg, typeName string) string
}

Dialect provides SQL dialect-specific formatting behavior

Jump to

Keyboard shortcuts

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