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

Function TransformDMLToSelect

backend/plugin/parser/pg/backup.go:66–73  ·  view source on GitHub ↗
(ctx context.Context, tCtx base.TransformContext, statement string, _ string, targetSchema string, tablePrefix string)

Source from the content-addressed store, hash-verified

64}
65
66func TransformDMLToSelect(ctx context.Context, tCtx base.TransformContext, statement string, _ string, targetSchema string, tablePrefix string) ([]base.BackupStatement, error) {
67 statementInfoList, err := prepareTransformation(ctx, tCtx, statement)
68 if err != nil {
69 return nil, errors.Wrapf(err, "failed to prepare transformation")
70 }
71
72 return generateSQL(statementInfoList, targetSchema, tablePrefix)
73}
74
75func generateSQL(statementInfoList []statementInfo, targetSchema string, tablePrefix string) ([]base.BackupStatement, error) {
76 groupByTable := make(map[string][]statementInfo)

Callers 1

TestBackupFunction · 0.70

Calls 2

prepareTransformationFunction · 0.70
generateSQLFunction · 0.70

Tested by 1

TestBackupFunction · 0.56