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
The Query.update has the signature: def update(f: (T => (Any, Any)), f2: (T => (Any, Any))*): Update[T] in Model.scala line 90. Based on that signature, the expectation is that both, a varargs invocation as well as a "deconstructed" sequence using the * operator would behave the same.
Actual behavior
An Exception is thrown by the macro processor when the syntax Seq(x1, x2, x3)* is used and no simple error message given. For the example below (in the Steps to Reproduce, the following is the result in two error messages in the sbt output: (with -Dquill.macro.log.pretty=true)
The obvious workaround is to use the explicit varargs construction, but this forces a lot of code repetition for flexible update methods and similar constructs.
It is understandable that this would be a problem for static compilation of SQL, but the macro expansion should fall back to dynamic query execution in those cases (as it does in other situations)
As an added comment, the same problem is also present in the querySchema call, although the need for "composability" is much less in that case.
@getquill/maintainers
The text was updated successfully, but these errors were encountered:
Scala:
3.3.1
Sbt:
1.9.6
Quill Version:
4.8.0
Module:
quill-jdbc-zio
Database:
postgres
Expected behavior
The
Query.update
has the signature:def update(f: (T => (Any, Any)), f2: (T => (Any, Any))*): Update[T]
inModel.scala
line 90. Based on that signature, the expectation is that both, a varargs invocation as well as a "deconstructed" sequence using the*
operator would behave the same.Actual behavior
An Exception is thrown by the macro processor when the syntax
Seq(x1, x2, x3)*
is used and no simple error message given. For the example below (in the Steps to Reproduce, the following is the result in two error messages in the sbt output: (with-Dquill.macro.log.pretty=true
)First Error
Second Error
Steps to reproduce the behavior
This self-contained file exhibits the problem with the obvious sbt dependencies added.
The
goodUpdate
method compiles, thebadUpdate
method does not in violation of the Scala calling convention with Varargs.Workaround
The obvious workaround is to use the explicit varargs construction, but this forces a lot of code repetition for flexible update methods and similar constructs.
It is understandable that this would be a problem for static compilation of SQL, but the macro expansion should fall back to dynamic query execution in those cases (as it does in other situations)
As an added comment, the same problem is also present in the
querySchema
call, although the need for "composability" is much less in that case.@getquill/maintainers
The text was updated successfully, but these errors were encountered: