MCPcopy
hub / github.com/sqldef/sqldef / normalizeMssqlSyntax

Function normalizeMssqlSyntax

database/mssql/parser.go:48–53  ·  view source on GitHub ↗

normalizeMssqlSyntax rewrites a few SQL Server export patterns into forms the generic parser already understands. Each pass must preserve comments, quoted strings, and bracketed identifiers so only real SQL tokens are rewritten.

(sql string)

Source from the content-addressed store, hash-verified

46// generic parser already understands. Each pass must preserve comments, quoted
47// strings, and bracketed identifiers so only real SQL tokens are rewritten.
48func normalizeMssqlSyntax(sql string) string {
49 sql = normalizeDefaultExpressions(sql)
50 sql = normalizeBracketedCastTypes(sql)
51 sql = normalizeBareReservedIdentifiers(sql)
52 return normalizeQualifiedReservedIdentifiers(sql)
53}
54
55// SQL Server exports DEFAULT constraints as nested parenthesized expressions
56// like DEFAULT ((0)) or DEFAULT (newid()). The generic parser only needs the

Callers 1

ParseMethod · 0.85

Tested by

no test coverage detected