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

Function extractRangeVarNames

backend/plugin/parser/pg/resource_change.go:217–228  ·  view source on GitHub ↗

extractRangeVarNames extracts database, schema, table from a RangeVar with defaults.

(rv *ast.RangeVar, defaultDB string, searchPath []string)

Source from the content-addressed store, hash-verified

215
216// extractRangeVarNames extracts database, schema, table from a RangeVar with defaults.
217func extractRangeVarNames(rv *ast.RangeVar, defaultDB string, searchPath []string) (string, string, string) {
218 db := rv.Catalogname
219 schema := rv.Schemaname
220 table := rv.Relname
221 if db == "" {
222 db = defaultDB
223 }
224 if schema == "" && len(searchPath) > 0 {
225 schema = searchPath[0]
226 }
227 return db, schema, table
228}
229
230// handleDropTableOmni handles DROP TABLE/MATERIALIZED VIEW.
231func handleDropTableOmni(n *ast.DropStmt, database string, searchPath []string, dbMetadata *model.DatabaseMetadata, changedResources *model.ChangedResources) {

Callers 1

extractChangedResourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected