-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to specify query binding arguments as symbols #463
Add support to specify query binding arguments as symbols #463
Conversation
Overall i don't see any issues with updating the query contract like this, but perhaps @mrrodriguez or @WilliamParker might. I do however think it would be nice to update the doc to include the expectation that the arg of a query is either a keyword or symbol. |
I can open a separate PR to update the doc as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try and keep a look out for the PR to clara-site
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops just noticed the test failures
Yes, I did too, I'm working on fixing them, will let you know when it's good to go. |
This test fails:
That is, in the query operation params are still expected to be keywords. My snap response right now is that this divergence is probably fine but will give it a bit more thought. |
…only keywords so that defquery syntax looks closer to function definition syntax.
6fb78bf
to
c92ae37
Compare
@WilliamParker @EthanEChristian I think I've addressed all the feedback, tests are passing, and all changes have been squashed together. |
I think I'd rather see the output always be keywords. It is a data structure at that point and we should use consistent types there. In general, it'd pretty odd to use symbol-keyed maps in clj anyways, so it'd also be fairly non-idiomatic. The symbols used in the actual definition of the query are more of a syntactic convenience to look closer to how one may expect things to be from a DSL perspective. I don't think the output needs to directly mirror the syntax used as input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#463 (comment) I believe this is how it is implemented (always returning kw keys for output)
So this all looks fine to me now.
@WilliamParker |
@EthanEChristian I've opened the docs update, please let me know if you have any suggestions: oracle-samples/clara-site#38 |
I missed this, but basically this and the docs change look fine, +1. |
This pull request adds support to specify query binding arguments as symbols instead of only keywords so that defquery syntax looks closer to function definition syntax.
Example from test case added: