You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yup, you got that right - typically you would have an a_expr in the WHERE clause if its a single expression, and a bool_expr if its multiple expressions. I don't have an example handy, but I think you're on the right track here.
If you want to know all the different variants, you could look at the gram.y file in Postgres, which all of this is based on. Specifically the a_expr rules would be relevant to understand the structure better:
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
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:
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!
The text was updated successfully, but these errors were encountered: