Skip to content

SelectBuilder does not allow usage of Condition in projection #1007

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

Closed
nt-gt opened this issue Jul 14, 2021 · 0 comments
Closed

SelectBuilder does not allow usage of Condition in projection #1007

nt-gt opened this issue Jul 14, 2021 · 0 comments
Assignees
Labels
in: selectbuilder SelectBuilder stands for the complete API for creating SQL statements programmatically. type: enhancement A general enhancement

Comments

@nt-gt
Copy link

nt-gt commented Jul 14, 2021

Hi,

Continuning my findings from #995, I noticed that SelectBuilder is too restrictive in regards to Select columns. Consider the valid query SELECT COUNT(*) > 100 FROM table_of_choice;. When run in postgres, you will receive a response like:

postgres=# SELECT COUNT(*) > 100 FROM table_of_choice;
 ?column?
----------
 f
(1 row)

The select(...) methods in SelectBuilder all assume that columns will be instances of Expressions. However, X > Y is a Condition and a Condition is not an instanceof Expression... :-/

My reason for trying this in the first place was to work around #995 / #1003 by leveraging a subselect (which counts as a Expression)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 14, 2021
@gregturn gregturn assigned gregturn and schauder and unassigned gregturn Jul 19, 2021
@gregturn gregturn added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 19, 2021
@schauder schauder added the in: selectbuilder SelectBuilder stands for the complete API for creating SQL statements programmatically. label Jul 21, 2021
schauder added a commit that referenced this issue Nov 4, 2021
This is supported by at least some database.

Closes #1007
@mp911de mp911de closed this as completed in bd8b3c6 Nov 8, 2021
mp911de added a commit that referenced this issue Nov 8, 2021
Reformat code.

See #1007
Original pull request: #1079.
@mp911de mp911de changed the title SelectBuilder is too restrictive on select clauses SelectBuilder does not allow usage of Condition in projection Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: selectbuilder SelectBuilder stands for the complete API for creating SQL statements programmatically. type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants