sea-query icon indicating copy to clipboard operation
sea-query copied to clipboard

Unify SelectStatement and WithQuery

Open bouk opened this issue 1 year ago • 0 comments

Motivation

WithQuery is currently a separate entity from SelectStatement which is unfortunate, because it restricts where you can use it, i.e. I'd like to use a WithQuery as a FROM with from_subquery in another query but I don't believe I can, because only SelectStatements are accepted.

https://github.com/SeaQL/sea-query/blob/53fd4e902910cf3db9f4332f1c1d1b6b6b3e49a6/src/query/select.rs#L1024

Proposed Solutions

Move with_clause into SelectStatement/UpdateStatement/DeleteStatement/InsertStatement instead of having a separate code path for it.

Additional Information

bouk avatar Sep 06 '24 09:09 bouk