Documentation
¶
Overview ¶
Package dialect provides SQL dialect definitions for the transpiler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsQuoteCharacters ¶ added in v1.1.0
ContainsQuoteCharacters returns true if the segment contains backticks, double quotes, or single quotes. These characters are used for identifier quoting and must not appear in raw variable names — the transpiler handles quoting automatically.
func NeedsQuoting ¶ added in v1.1.0
NeedsQuoting returns true if an identifier segment requires quoting. A segment needs quoting if it starts with a digit or contains characters other than letters, digits, and underscores.
func QuoteIdentifierSegment ¶ added in v1.1.0
QuoteIdentifierSegment wraps a single identifier segment with dialect-appropriate quote characters. It also escapes any embedded quote characters within the segment.
- BigQuery / Spanner / ClickHouse: backtick (`)
- PostgreSQL / DuckDB: double quote (")
Types ¶
type Dialect ¶
type Dialect int
Dialect represents a SQL dialect that the transpiler can target.
const ( // DialectUnspecified is the zero value, indicating no dialect was set. // This will cause an error if used - users must explicitly set a dialect. DialectUnspecified Dialect = iota // DialectBigQuery targets Google BigQuery SQL syntax. DialectBigQuery // DialectSpanner targets Google Cloud Spanner SQL syntax. DialectSpanner // DialectPostgreSQL targets PostgreSQL SQL syntax. DialectPostgreSQL // DialectDuckDB targets DuckDB SQL syntax. DialectDuckDB // DialectClickHouse targets ClickHouse SQL syntax. DialectClickHouse )