You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error when validating a query provided to the run method would return a failed ZIO.
Actual behavior
The method throws an IllegalStateException.
Steps to reproduce the behavior
case class MyTable(stringField: String, intField: Int)
ZIO.serviceWithZIO[Postgres[SnakeCase]] { postgres =>
// Should be `_.stringField == lift(string)`
val selectQuery = quote(query[MyTable].filter(_.stringField == string).value)
postgres.run(selectQuery)
}.tapErrorCause(e => ZIO.logErrorCause("Oh no!", e))
Because an exception is being thrown the error logging is bypassed.
Workaround
Declaring the query as an inline def allows this particular mistake to be picked up at compile time (but I would think this would still be an issue for any dynamic queries that couldn't be checked during compilation).
@getquill/maintainers
The text was updated successfully, but these errors were encountered:
Version: 4.6.0.1
Module: quill-jdbc-zio
Database: Postgres
Expected behavior
An error when validating a query provided to the run method would return a failed ZIO.
Actual behavior
The method throws an IllegalStateException.
Steps to reproduce the behavior
Because an exception is being thrown the error logging is bypassed.
Workaround
Declaring the query as an
inline def
allows this particular mistake to be picked up at compile time (but I would think this would still be an issue for any dynamic queries that couldn't be checked during compilation).@getquill/maintainers
The text was updated successfully, but these errors were encountered: