Motivation
I'd like to use shorthand joins, so instead of
INNER JOIN table ON (table.x = other.x AND table.y = other.y)
I could do
INNER JOIN table USING (x, y)
This makes for easier to read queries in logs, but is ofc just syntactic sugar (with one rarely useful feature of not duplicating the columns in SELECT *).
Proposed Solutions
Glancing at the code, looks like making JoinOn::Columns generate code should be enough (as long as the struct/field naming isn't a problem) - https://github.com/SeaQL/sea-query/blob/master/src/backend/query_builder.rs#L1012
With a new SelectStatement method like .join_using.
Additional Information
Postgres, MySQL and SQLite all support this. MS SQL doesn't, but afaik that's not in the scope of this repo.
Motivation
I'd like to use shorthand joins, so instead of
I could do
INNER JOIN table USING (x, y)This makes for easier to read queries in logs, but is ofc just syntactic sugar (with one rarely useful feature of not duplicating the columns in
SELECT *).Proposed Solutions
Glancing at the code, looks like making
JoinOn::Columnsgenerate code should be enough (as long as the struct/field naming isn't a problem) - https://github.com/SeaQL/sea-query/blob/master/src/backend/query_builder.rs#L1012With a new
SelectStatementmethod like.join_using.Additional Information
Postgres, MySQL and SQLite all support this. MS SQL doesn't, but afaik that's not in the scope of this repo.