MCPcopy
hub / github.com/sqlc-dev/sqlc / QuoteIdent

Method QuoteIdent

internal/engine/postgresql/reserved.go:21–26  ·  view source on GitHub ↗

QuoteIdent returns a quoted identifier if it needs quoting. This implements the format.Dialect interface.

(s string)

Source from the content-addressed store, hash-verified

19// QuoteIdent returns a quoted identifier if it needs quoting.
20// This implements the format.Dialect interface.
21func (p *Parser) QuoteIdent(s string) string {
22 if p.IsReservedKeyword(s) || hasMixedCase(s) {
23 return `"` + s + `"`
24 }
25 return s
26}
27
28// TypeName returns the SQL type name for the given namespace and name.
29// This implements the format.Dialect interface.

Callers

nothing calls this directly

Implementers 4

Parserinternal/engine/postgresql/parse.go
Parserinternal/engine/dolphin/parse.go
Parserinternal/engine/clickhouse/parse.go
Parserinternal/engine/sqlite/parse.go

Calls 2

IsReservedKeywordMethod · 0.95
hasMixedCaseFunction · 0.85

Tested by

no test coverage detected