MCPcopy Create free account
hub / github.com/PostHog/duckgres / Transform

Method Transform

transpiler/transform/locking.go:20–35  ·  view source on GitHub ↗
(tree *pg_query.ParseResult, result *Result)

Source from the content-addressed store, hash-verified

18}
19
20func (t *LockingTransform) Transform(tree *pg_query.ParseResult, result *Result) (bool, error) {
21 changed := false
22
23 // Locking clauses can appear at any depth (subquery, CTE, EXISTS sublink,
24 // set-operation arm), and DuckDB rejects them all.
25 WalkFunc(tree, func(node *pg_query.Node) bool {
26 if sel := node.GetSelectStmt(); sel != nil {
27 if stripLockingClauses(sel) {
28 changed = true
29 }
30 }
31 return true
32 })
33
34 return changed, nil
35}
36
37// stripLockingClauses clears the locking clause on sel and on its
38// set-operation arms. walkSelectStmt recurses into Larg/Rarg without invoking

Callers

nothing calls this directly

Calls 2

WalkFuncFunction · 0.85
stripLockingClausesFunction · 0.85

Tested by

no test coverage detected