I'm looking to expand the update statement. It may be something specific to postgres, but the SET clauses can be expressions
UPDATE table
SET
ts = NOW()
, text = SOME_FN( VARIADIC ARRAY(<SUBQUERY>) )
What isn't apparently obvious to me is what can be an expression and what can not be. I guess what I'm looking for is the low level bits that convert the SQL AST objects into the query. is there one?
What does this?
const sql = convertToSQL({
':fn()': [
'arg1'
, {':lower()', {':plain': 'foobar'}}
, sql.statement('select').where(...)
]
})
The more I use this package, the more I see it as a generic sql compiler. The problem I tent to run into is that not everything uses the AST, for lack of a better term.
update set clauses, order by clauses, for example don't allow this, but SQL does.
I'm looking to expand the update statement. It may be something specific to postgres, but the
SETclauses can be expressionsWhat isn't apparently obvious to me is what can be an expression and what can not be. I guess what I'm looking for is the low level bits that convert the SQL AST objects into the query. is there one?
What does this?
The more I use this package, the more I see it as a generic sql compiler. The problem I tent to run into is that not everything uses the AST, for lack of a better term.
update set clauses, order by clauses, for example don't allow this, but SQL does.