-
Notifications
You must be signed in to change notification settings - Fork 10
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
Pull API / Wildcard Support #97
Comments
@MioQuispe I think exposing the pull API would give you what you want. E.g. const id = 123
const [client] = useClient()
client.pull('*', id) // => { a1: 'v1', a2: 'v2, ... } Additionally, if we want to make pulls reactive we can also expose the API over a hook directly const id = 123
const [data] = usePull('*', id)
data // => { a1: 'v1', a2: 'v2, ... } To better understand which APIs we should prioritize can you talk more about your use case? Why do you want to copy all attributes of one entity into another entity instead of referencing the original entity? |
Cool! Yeah that would solve it. I don't actually need the reactivity here. |
Hey @MioQuispe. I looked into this and it involves converting from EDN (the Clojure data format) to JSON. This is a feature we'd like to add, but it's a bit more complicated than just exposing one of the DB APIs. At the moment we make a bunch of assumptions when going from JSON → EDN and never go from EDN → JSON. Going in reverse would require precisely tracking all the assumptions and mapping them to the reverse transformation. Since this is not high on our priority list it will probably be a while before we get to it. |
re: entity.get("*"), this is roughly what I'm trying to do.
So again this is just querying the database directly, no need to subscribe to anything. but on the other hand if it is only exposed when querying the database directly, that could feel a bit inconsistent?
I'm actually not sure yet I will need it to be this dynamic, so hardcoding the props is okay in the meantime. but it was something I thought would be there and went looking for in the docs.
Cheers.
Originally posted by @MioQuispe in #80 (comment)
The text was updated successfully, but these errors were encountered: