-
Notifications
You must be signed in to change notification settings - Fork 96
Open
Labels
Description
I am trying to inject my own where clauses into a SQL statement
I can access the node here: parsed_query.tree.stmts[0].stmt.select_stmt.where_clause
pg_query/lib/pg_query/filter_columns.rb
Line 59 in 831173c
| next_item = condition_items.shift |
I am trying to understand, is it always an :a_expr if it is one where_clause and a :bool_expr if it has an "AND"?
Am I correct that I would have to create my own new where_clause node this:
<PgQuery::Node.new
bool_expr: <PgQuery::BoolExpr.new boolop: :AND_EXPR
And then put my own clauses in there using the and? Would there happen to be any code sample for creating a new where_clause? Thank you for the help!
Reactions are currently unavailable