MCPcopy
hub / github.com/sqldef/sqldef / normalizeQualifiedName

Function normalizeQualifiedName

schema/parser.go:1040–1054  ·  view source on GitHub ↗

normalizeQualifiedName creates a QualifiedName from a parser.TableName

(mode GeneratorMode, tableName parser.TableName, defaultSchema string)

Source from the content-addressed store, hash-verified

1038
1039// normalizeQualifiedName creates a QualifiedName from a parser.TableName
1040func normalizeQualifiedName(mode GeneratorMode, tableName parser.TableName, defaultSchema string) QualifiedName {
1041 var schemaIdent Ident
1042 if mode == GeneratorModePostgres || mode == GeneratorModeMssql {
1043 if !tableName.Schema.IsEmpty() {
1044 schemaIdent = tableName.Schema
1045 } else {
1046 schemaIdent = Ident{Name: defaultSchema, Quoted: false}
1047 }
1048 }
1049
1050 return QualifiedName{
1051 Schema: schemaIdent,
1052 Name: tableName.Name,
1053 }
1054}
1055
1056// normalizeQualifiedObjectName creates a QualifiedName from a parser.ObjectName
1057func normalizeQualifiedObjectName(mode GeneratorMode, objectName parser.ObjectName, defaultSchema string) QualifiedName {

Callers 3

parseDDLFunction · 0.85
parsePartitionOfFunction · 0.85
parseTableFunction · 0.85

Calls 1

IsEmptyMethod · 0.45

Tested by

no test coverage detected