MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / RemoveReturning

Function RemoveReturning

pkg/transform/returning.go:73–82  ·  view source on GitHub ↗

RemoveReturning returns a Rule that clears the entire RETURNING clause from an INSERT, UPDATE, or DELETE statement. If the clause is already empty the rule is a no-op (no error). Returns ErrUnsupportedStatement for SELECT or DDL statements. Example: transform.Apply(stmt, transform.RemoveReturnin

()

Source from the content-addressed store, hash-verified

71//
72// transform.Apply(stmt, transform.RemoveReturning())
73func RemoveReturning() Rule {
74 return RuleFunc(func(stmt ast.Statement) error {
75 ret, err := getReturning(stmt)
76 if err != nil {
77 return err
78 }
79 *ret = nil
80 return nil
81 })
82}

Calls 2

RuleFuncFuncType · 0.85
getReturningFunction · 0.85