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

select(*).from(table) #829

Merged
merged 7 commits into from
Feb 13, 2023
Merged

select(*).from(table) #829

merged 7 commits into from
Feb 13, 2023

Conversation

sviezypan
Copy link
Collaborator

@sviezypan sviezypan commented Feb 13, 2023

This PR introduces long awaited feature

select(*).from(table)

Known limitations:

  • does not work with joined tables e.g. select(*).from(users.join(orders).on(customerId == id)
  • does not work with more than 22 columns. In order for this to work we would need a macro. Macro would needs access to SelectionSet, however macro needs to be compiled before the call site (sql.scala), which inherits select module (which contains SelectionSet). We can make it work but we would need to re-architecture whole core module in a way that it would not have modules anymore.

Also the TrailingUnitNormalizer class which was flattening tuples is now a macro. This makes possible to flatten also nested tuples which have more bigger than 22 elements.

@sviezypan sviezypan requested a review from a team as a code owner February 13, 2023 08:31
@sviezypan sviezypan changed the title select(*).from(users) select(*).from(table) Feb 13, 2023
@jczuchnowski jczuchnowski merged commit 50deb4b into zio:master Feb 13, 2023
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