-
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 using raw query #2672
Comments
Are raw queries still broken? I ask as I'm doing similar, for a query that runs fine in raw jdbc, but complains val top2Messages = quote {
sql"SELECT TOP (2) message FROM xyz.in".as[Query[String]]
}
println(top2Messages.toString())
val ret=ctx.run(top2Messages)
println(ret) I get And that same query is fine in raw jdbc |
This is still happening for me on 4.6.1 (postgres + zio), it's tuples specifically so single The workaround is to name the fields |
Seems still broken in 4.7.3. I'm using quill-cassandra-zio. The workarounds suggested precedently don't work for me for both version 4.6.1 and 4.7.3. |
What about using a case class to replace the Tuple as a workaround? final case class Result(id: Int, name: Int)
val q = quote {
sql"""select id, name from users""".as[Query[Result]]
}
val res = run(q) ? |
Hi @guizmaii 👋 , thanks for quick response. |
Version: 4.6.0
Module: quill-jdbc-zio
Database: mysql
Getting invalid sql with raw query. for example this query
Expected behavior
According to documentation is should generate this valid sql
Actual behavior
but it generate this invalid sql
this create error: Unknown column 'x.1' in 'field list'
Workaround
the only way I could make it work is with this query
@getquill/maintainers
The text was updated successfully, but these errors were encountered: