-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Passing in variables for attribute query #310
Comments
Since your query is quoted ( Instead use query variables:
The reason for this is, at least in datomic, is that the queries are compiled and that compilation is cached somehow. The inlining in the queries would make that caching harder. |
@claj @tonsky Again, I think this is what is happening because when I searched for the keyword I pass, it is nowhere to be found in the How do I protect the Or there could be something else going on that I am not aware of. |
No, keywords are not munged. Probably something else is going on. Why don’t you describe in full what are you doing, what are you expecting and what are you getting out of it? |
@tonsky @claj Here is the description. And thank you in advance for taking your precious time to look at this TerminologyBy PROD here I just mean that I am compiling with shadow-cljs, to get a JS file that is part of my react native application. It uses advanced compilation of course and that is the only thing I could think of that would be different when I run it on the device vs. in the simulator ProblemI am using re-frame and would like to use a subscription to generically pull data from datascript. But rather than write a different subscription for every single type of entity, I want to create 2-3 generic ones Right now I am working to load data from datascript for a dashboard. Once i get this working generically, I can load lots of other data using this single subscription.
The functions executed to pull the Entity IDs (eids) and the events are here below (dq/querytree)
EnvironmentReact Native, Expo and Re-frame mobile application. |
Just a wild guess: take a look at #298 (comment) |
Confirming as well that this query
WORKS just by adding this to my shadow-cljs.edn file
I got the answer as @tonsky rightly pointed out in issue #298
|
I added a section under the wiki Tips & Tricks section. |
Hi @tonsky
I am just loving this library and I am trying to get something rather generic going
Challenge
Call this function and pass in a keyword that is one of my attributes. in this case :event/name
Exception
Datascript says it expected a pattern .. etc.
I would expect this would work but for some reason it does not seem to. I am on v0.18.4
Thanks for your help
The text was updated successfully, but these errors were encountered: