MCPcopy Create free account
hub / github.com/andywer/postguard / isPlaceholderSelect

Function isPlaceholderSelect

src/postgres/parse-pg-query.ts:50–56  ·  view source on GitHub ↗
(node: QueryParser.QueryNode<any>)

Source from the content-addressed store, hash-verified

48)
49
50const isPlaceholderSelect = (node: QueryParser.QueryNode<any>) =>
51 isSelectStmt(node) &&
52 !node.SelectStmt.fromClause &&
53 node.SelectStmt.targetList &&
54 node.SelectStmt.targetList.length === 1 &&
55 isResTarget(node.SelectStmt.targetList[0]) &&
56 isParamRef(node.SelectStmt.targetList[0].ResTarget.val)
57
58const isSubquery = (node: QueryParser.QueryNode<any>) =>
59 getNodeType(node).endsWith("Stmt") && !isPlaceholderSelect(node)

Callers 1

isSubqueryFunction · 0.85

Calls 3

isSelectStmtFunction · 0.90
isResTargetFunction · 0.90
isParamRefFunction · 0.90

Tested by

no test coverage detected