-
Notifications
You must be signed in to change notification settings - Fork 348
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
Invalid SQL when Nested after Query and Embedded is Used #1632
Comments
Whoops, what I was saying before was wrong. This does seem to work for distinct though: val q = quote {
query[MyParent]
.distinct
.filter(_.myEmb.name == "bug")
}
// SELECT x1.myEmbname FROM (SELECT DISTINCT x1.name AS myEmbname FROM MyParent x1 WHERE x1.name = 'bug') AS x1 @rodrigopalhares |
@deusaquilus currently, manually setting a Regarding the use case, we have some complex sub queries (that use |
This is a simplified version of the real query. Workaround add implicit
Or alias to dynamic query:
|
OK. Good to hear. I have a fix for this, PR was opened this morning. This
issue is actually deeper than I thought. Thanks for bringing it to my
attention.
…On Mon, Sep 23, 2019 at 8:55 AM Rodrigo Palhares ***@***.***> wrote:
This simplified version of the real query.
Workaround add implicit schemaMeta for normal query:
implicit val parentSchema = schemaMeta[MyParent]("my_parents")
run {
query[MyParent]
.nested
.filter(_.myEmb.name == "bug")
}
Or alias to dynamic query:
run {
dynamicQuerySchema[MyParent]("my_parents",
alias(_.myEmb.name, "name")
)
.nested
.filter(_.myEmb.name == "bug")
}
Live workaround <https://scastie.scala-lang.org/xhCv4rweRGS35KMNtLWY9w>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1632>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKOLCFXRFMKKZOPZSO5F33QLC4DVANCNFSM4IYY46EA>
.
|
Thank you for looking into it so quickly. :-) |
Quill generate a wrong query when referencing a EMBEDED entity in a NEST entity.
Version:
3.4.8
Module:
quill-core
Database:
postgres
Expected behavior
SELECT x1.my_embname FROM (SELECT x.name AS myEmbname FROM my_parents x) AS x1 WHERE x1.myEmbname = 'bug'
Actual behavior
SELECT x1.my_embname FROM (SELECT x.name AS myEmbname FROM my_parents x) AS x1 WHERE x1.name = 'bug'
Workaround
@getquill/maintainers
The text was updated successfully, but these errors were encountered: