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 @querify macro is.... not built very well. The issue is that it is piecemeal converting Expr's to strings, and it is doing that directly, at compile-time, when what it should be doing is converting Exprs to other Expr's that result in Strings, so that the caller stitches all the Strings together. Without that fundamental change, the macro doesn't have access to the value of the variable you're trying to pass in at compile-time. Whoops.
Anyone who wants to try and rewrite this has my blessing. Even better, if there's a standard query parsing package, that would be even better!
Activity
staticfloat commentedon Jan 7, 2021
The
@querifymacro is.... not built very well. The issue is that it is piecemeal convertingExpr's to strings, and it is doing that directly, at compile-time, when what it should be doing is convertingExprs to otherExpr's that result inStrings, so that the caller stitches all theStrings together. Without that fundamental change, the macro doesn't have access to the value of the variable you're trying to pass in at compile-time. Whoops.Anyone who wants to try and rewrite this has my blessing. Even better, if there's a standard query parsing package, that would be even better!
MarcMush commentedon Jan 7, 2021
I found it easier to directly write
conditionas a string, which can be interpolated without problem