MCPcopy Create free account
hub / github.com/bytebase/bytebase / wtSplitQualifiedName

Function wtSplitQualifiedName

backend/plugin/schema/pg/walk_through_loader.go:1197–1221  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

1195}
1196
1197func wtSplitQualifiedName(s string) (schema, name string, ok bool) {
1198 var parts []string
1199 var cur strings.Builder
1200 inQuote := false
1201 for i := 0; i < len(s); i++ {
1202 c := s[i]
1203 switch {
1204 case c == '"':
1205 inQuote = !inQuote
1206 case c == '.' && !inQuote:
1207 parts = append(parts, cur.String())
1208 cur.Reset()
1209 default:
1210 cur.WriteByte(c)
1211 }
1212 }
1213 if inQuote {
1214 return "", "", false
1215 }
1216 parts = append(parts, cur.String())
1217 if len(parts) != 2 {
1218 return "", "", false
1219 }
1220 return parts[0], parts[1], true
1221}
1222
1223func wtIsSystemSchema(s string) bool {
1224 switch s {

Callers 1

wtExtractUserTypeRefsFunction · 0.85

Calls 2

StringMethod · 0.65
ResetMethod · 0.45

Tested by

no test coverage detected