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
Right now, for the compile-time query printout, all lifted variables are question marks:
valctx=newSqlMirrorContext(SQLServerDialect, SnakeCase)
importctx._caseclassPerson(name:String, age:Long)
valnameValue="Joe"valageValue=22
run(query[Person].filter(p => p.name == lift(nameValue) && p.age > lift(ageValue))).string
// SELECT p.name, p.age FROM person p WHERE p.name = ? AND p.age > ?
It would be much more useful to use either the name of the case-class/tuple variable
SELECT p.name, p.age FROM person p WHERE p.name = ${name} AND p.age > ${age}
...or the variable name that is being used
SELECT p.name, p.age FROM person p WHERE p.name = ${nameValue} AND p.age > ${ageValue}
The former is a better solution but it is very hard to do because Quill only tracks lifted variables by position. The latter option is simpler because ScalarValueLift already has the variable name which of course does not work if it's a compound statement but we could detect such a situation and have a fallback.
@getquill/maintainers
The text was updated successfully, but these errors were encountered:
Version: (e.g.
3.4.8
)Module: (e.g.
quill-sql
)Database: (e.g.
mysql
)Right now, for the compile-time query printout, all lifted variables are question marks:
It would be much more useful to use either the name of the case-class/tuple variable
...or the variable name that is being used
The former is a better solution but it is very hard to do because Quill only tracks lifted variables by position. The latter option is simpler because
ScalarValueLift
already has the variable name which of course does not work if it's a compound statement but we could detect such a situation and have a fallback.@getquill/maintainers
The text was updated successfully, but these errors were encountered: