Both MERGE and INSERT queries have two variants: one for using VALUES (...) and the other to use a nested SELECT query or arbitrary expression.
This could be solved by materialising a constant table query implementation, which would be a table expression, and be used in place of any other expression.
This way we could systematically have both ->query(Query) and ->values() methods on those queries, values accepting either a callable which gives you a ExpressionConstantTable or such parameter, which yields a ->values() method, or uses an ExpressionConstantTable internally to populate using given array.
We won't have to handle two different implementations anymore, and it would solve #11.
Both MERGE and INSERT queries have two variants: one for using VALUES (...) and the other to use a nested SELECT query or arbitrary expression.
This could be solved by materialising a constant table query implementation, which would be a table expression, and be used in place of any other expression.
This way we could systematically have both
->query(Query)
and->values()
methods on those queries, values accepting either a callable which gives you aExpressionConstantTable
or such parameter, which yields a->values()
method, or uses anExpressionConstantTable
internally to populate using given array.We won't have to handle two different implementations anymore, and it would solve #11.