We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version: 0.7.0
0.7.0
Run the following code:
import io.getquill._ case class user(id: Long, name: String, age: Int) object Main extends App { val db = source(new SqlMirrorSourceConfig[naming.Escape]("db")) val q = quote { query[user].map(u => u.name).distinct.size } println(db.run(q).sql) }
SELECT COUNT(DISTINCT "u"."name") FROM "user" "u"
SELECT DISTINCT COUNT("u"."name") FROM "user" "u"
@getquill/maintainers
The text was updated successfully, but these errors were encountered:
workaround:
import testContext._ implicit class CountDistinct[T](q: Query[T]) { def countDistinct = quote(q.map(v => infix"count(distinct $v))".as[Long])) } case class User(name: String) val q = quote { query[User].map(_.name).countDistinct }
Sorry, something went wrong.
Update caliban-quick to 2.6.0 (#436)
6625a39
Co-authored-by: zio-scala-steward[bot] <145262613+zio-scala-steward[bot]@users.noreply.github.com>
No branches or pull requests
Version:
0.7.0
Steps to reproduce the behavior
Run the following code:
Expected behavior
SELECT COUNT(DISTINCT "u"."name") FROM "user" "u"
Actual behavior
SELECT DISTINCT COUNT("u"."name") FROM "user" "u"
@getquill/maintainers
The text was updated successfully, but these errors were encountered: