Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH Allow selecting multiple (or no) tables #10953

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Sep 21, 2023

Currently to select multiple tables in an SQLSelect query, you need to explicitly add a comma to subsequent tables in the FROM clause. This is a pretty bad smell, isn't intuitive or documented, and will make it harder to use Common Table Expressions (aka WITH clauses) once those are implemented - so this seems like a good time to remove that limitation.

Also allows selecting NO tables, e.g. SELECT 1; is a perfectly valid SQL select statement. These can be useful in testing things like unions, but are also sometimes useful in Common Table Expressions.

Issue

@GuySartorelli GuySartorelli changed the title FIX Allow selecting multiple tables ENH Allow selecting multiple tables Sep 21, 2023
@GuySartorelli GuySartorelli changed the title ENH Allow selecting multiple tables ENH Allow selecting multiple (or no) tables Sep 21, 2023
@GuySartorelli GuySartorelli force-pushed the pulls/5/fix-table-from branch 4 times, most recently from 7b31cd0 to 024c965 Compare September 21, 2023 03:07
src/ORM/Connect/DBQueryBuilder.php Outdated Show resolved Hide resolved
@emteknetnz emteknetnz merged commit b28749d into silverstripe:5 Sep 24, 2023
15 checks passed
@emteknetnz emteknetnz deleted the pulls/5/fix-table-from branch September 24, 2023 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants