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

Better Dynamic Query DSL For Quats on JVM #1993

Merged
merged 1 commit into from
Oct 1, 2020
Merged

Conversation

deusaquilus
Copy link
Collaborator

Fixes #1990

Problem

The DynamicQueryDsl does not infer Quats correctly due to several reasons:

  1. The best way to determinate whether a field is a Quat.Value is to see if an implicit encoder can be summoned for it. Since this is not possible to do during runtime, either a pre-specified list or rules-of-thumb need to be used.
  2. Since the quill-sql module also needs to be compiled with scala-js, DynamicQueryDsl cannot use TypeTags. This means it is very difficult to tell which methods of a class are case class methods. Hence methods which should not be introspected are being introspected which in some cases leads to Stack Overflow Exceptions.

Solution

We need to have a different DynamicQueryDsl implementation for Scala and for ScalaJS. The former (JVM-based) implementation will have TypeTags and will more robustly be able to detect case class methods.

Checklist

  • Unit test all changes
  • Update README.md if applicable
  • Add [WIP] to the pull request title if it's work in progress
  • Squash commits that aren't meaningful changes
  • Run sbt scalariformFormat test:scalariformFormat to make sure that the source files are formatted

@getquill/maintainers

@deusaquilus deusaquilus changed the title Better Dynamic Query DSL For Quats on JVM [WIP] Better Dynamic Query DSL For Quats on JVM Sep 30, 2020
@deusaquilus deusaquilus merged commit 0735fc9 into master Oct 1, 2020
@deusaquilus deusaquilus changed the title [WIP] Better Dynamic Query DSL For Quats on JVM Better Dynamic Query DSL For Quats on JVM Oct 1, 2020
@deusaquilus deusaquilus deleted the quats_dynamic branch July 11, 2021 07:56
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.

Regression in dynamic query - StackOverflowError
1 participant