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

Function resolveDMLTargetTable

backend/plugin/parser/tsql/backup.go:244–255  ·  view source on GitHub ↗
(relation ast.TableExpr, fromClause *ast.List, databaseName string)

Source from the content-addressed store, hash-verified

242}
243
244func resolveDMLTargetTable(relation ast.TableExpr, fromClause *ast.List, databaseName string) (*TableReference, error) {
245 table, err := tableReferenceFromTableExpr(relation, databaseName, defaultSchema)
246 if err != nil || table == nil {
247 return table, err
248 }
249 if fromClause != nil && table.Database == databaseName && table.Schema == defaultSchema {
250 if physical := findPhysicalTableForAlias(fromClause, table); physical != nil {
251 return physical, nil
252 }
253 }
254 return table, nil
255}
256
257func tableReferenceFromTableExpr(expr ast.TableExpr, defaultDatabase, defaultSchema string) (*TableReference, error) {
258 ref, ok := expr.(*ast.TableRef)

Callers 1

prepareTransformationFunction · 0.70

Calls 2

Tested by

no test coverage detected