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
First, this is a fantastic library -- thanks! I only discovered it yesterday so I'm still wrapping my head around it, but the documentation is really good.
The only wall I've hit so far:
I'd like to use placeholders for #:order-by. (Motivation: Imagine a query that wants to reflect a user clicking column headers.)
You're right, that code should use emit-scalar-expr instead of emit-name. I'll push the change.
Placeholders can only stand for SQL scalar constants, not expressions or things like order directions. Abusing ScalarExpr:INJECT is probably the best solution for now.
Longer-term, I could imagine adding more dynamic AST manipulation support and more nonterminal escapes, so you could write something like
First, this is a fantastic library -- thanks! I only discovered it yesterday so I'm still wrapping my head around it, but the documentation is really good.
The only wall I've hit so far:
I'd like to use placeholders for
#:order-by
. (Motivation: Imagine a query that wants to reflect a user clicking column headers.)But trying to use
#:order-by ,order-by-column
gives an error because the
SelectOrderItem
syntax pattern usesScalarExpr
:whereas later
emit-select-order
usesemit-name
:In addition, I'm not sure how to specify
#:asc
or#:desc
keywords for the direction, using placeholders?I tried hacking the latter instead to use
emit-scalar-expression
. This way, I can at least do something likeand "it works". Albeit using INJECT isn't ideal.
Is this pilot error? Or if there's a bug/omission, is my change a reasonable fix I should PR, or a bad hack?
Thanks!
The text was updated successfully, but these errors were encountered: