MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / SQLStringFullyQualified

Method SQLStringFullyQualified

pkg/sql/types/types.go:2125–2140  ·  view source on GitHub ↗

SQLStringFullyQualified is a wrapper for SQLString() for when we need the type name to be a fully-qualified 3-part name.

()

Source from the content-addressed store, hash-verified

2123// SQLStringFullyQualified is a wrapper for SQLString() for when we need the
2124// type name to be a fully-qualified 3-part name.
2125func (t *T) SQLStringFullyQualified() string {
2126 if t.UserDefined() {
2127 switch t.Family() {
2128 case ArrayFamily:
2129 return t.ArrayContents().SQLStringFullyQualified() + "[]"
2130 default:
2131 if t.TypeMeta.Name != nil {
2132 // Include the catalog in the type name. This is necessary to properly
2133 // resolve the type, as some code paths require the database name to
2134 // correctly distinguish cross-database references.
2135 return t.TypeMeta.Name.FQName(true /* explicitCatalog */)
2136 }
2137 }
2138 }
2139 return t.SQLString()
2140}
2141
2142// SQLStringForError returns a version of SQLString that will preserve safe
2143// information during redaction. It is suitable for usage in error messages.

Callers 1

FormatTypeReferenceMethod · 0.80

Calls 5

UserDefinedMethod · 0.95
FamilyMethod · 0.95
ArrayContentsMethod · 0.95
SQLStringMethod · 0.95
FQNameMethod · 0.80

Tested by

no test coverage detected