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

Function deparseInnerQuery

server/conn_cursor.go:18–27  ·  view source on GitHub ↗

--- Server-side cursor emulation --- deparseInnerQuery deparses a pg_query Node back to SQL text.

(node *pg_query.Node)

Source from the content-addressed store, hash-verified

16
17// deparseInnerQuery deparses a pg_query Node back to SQL text.
18func deparseInnerQuery(node *pg_query.Node) string {
19 tree := &pg_query.ParseResult{
20 Stmts: []*pg_query.RawStmt{{Stmt: node}},
21 }
22 sql, err := pg_query.Deparse(tree)
23 if err != nil {
24 return ""
25 }
26 return sql
27}
28
29// openCursor executes the cursor's stored query and caches the result set metadata.
30func (c *clientConn) openCursor(cursor *cursorState) error {

Callers 3

handleParseMethod · 0.85
handleDeclareCursorMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected