Documentation
¶
Overview ¶
Package ident turns arbitrary CSV headers and JSON keys into safe SQL identifiers: snake_case where possible, quoted where necessary, unique within a table, and never colliding with a reserved word unquoted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dedupe ¶
Dedupe makes every name unique in order, appending _2, _3, … to later duplicates. The first occurrence keeps its bare name.
func NeedsQuote ¶
NeedsQuote reports whether an identifier must be double-quoted: anything that is not a bare ASCII snake_case word, or that is a reserved word.
func Quote ¶
Quote renders an identifier for SQL, double-quoting only when required. Double-quote quoting with `""` escaping is shared by Postgres, SQLite and DuckDB, so one implementation serves all three dialects.
Types ¶
This section is empty.