I do not understand your intention. ao-identity?
is a HINT to the RAD plugins that the given attribute can be used to find rows/entities, etc. It lets db plugs do things like generate indexes on that column, etc.
The ao/identities
is says what ID you can use to FIND the the attribute on which it is declared. So, you’re saying :content/id
is an attribute that can be found IF you know either a :category/id
or an :element/id
. This is how the RAD plugins do things like figure out “entity” or “table” groupings (if supported in the given db), but it is also used to generate resolvers (if you have :category/id, then I can given you a :content/id).
in terms of “creation”. RAD Forms only know about the primary ID of an entity. The fact that there is an extra ID is up to you to deal with. I’d recommend looking at save middleware. You could examine incoming save deltas and augment them.
So, your RAD form probably would not even mention the alt ID? Not sure what all you’re trying to do, but those are my initial thoughts
I did mention it, but yes I'm sorry, my example wasn't very good. I've read all the docs and docstrings and watched your videos, so I think I roughly understand what's going on. I was just thinking way to complicated yesterday. Basically my intention is to connect all kinds of entities via an edge entity that has lots of metadata like so:
{:edge/id ...
:edge/origin :ref ;; to whatever entity
:edge/targets :ref ;; to multiply entities of any "type"
:edge... ;; lots of other stuff
}
But now I'd need multiple keywords (all my various entity ids) for the ao/target
on my origin
and targets
attributes, which obviously doesn't work. That's where my idea for a global :content/id
attribute came from, that I slap on every entity.
Anyway, I'll give the save-middlerware a shot. Thank you> So, you’re saying `:content/id` is an attribute that can be found IF you know either a `:category/id` or an `:element/id`. Oh I think that's my problem, I wanted it the other way around. Thanks again. I shouldn't code after midnight
No, don’t do any of that content/id mess. What you want is to add all of your ID keys to identities
on :edge/origin
, etc. That is then in the intended design
oh, no, I see: to-many edges need many edge facts
If you’re using UUIDs, then a natural key for an edge is source-id, target-id
Well, you're right it turned out to be a mess indeed! I think simplifying my edges to only have one target would help here
not sure if leveraging that is easy for your application logic, but then you don’t need edges to have an id of their own…depends on if you want to reify the edge in a query of the graph (flatten it into the child, for example) or if you’re just trying to store it for separate analysis
Well, what I'm trying to do is modeling edges that act as constraints.
So I can build a queries that walk a graph, but stop on certain edges that are forbidden
.
Or I walk a graph further down when I come across and edge that marks another entity as required
.
I designed this schema for datomic before starting this project, and I'm new to graph dbs and datomic, so I'm sorry if some of my statements seem confusing. I'm trying to figure things out as I go.
But I'll give both your advices a try, I'm going to throw away my content/id thing and simplify my target attribute to a to-one
ref. But thinking about your second point - flattening the edges into my entities might be a bit more work initially but should simplify it even more.
I think I can figure it out from here. Thanks for your time, I really appreciate it! I'll build an exmple project for everyone to check it out once I solve this
.17 is working for me in quite large apps with dyn routing. Stale files, perhaps?
does it matter if I use a function for the :query
as compared to just a vector? the book suggests saving them for unions from what I've seen.
Using lambda notation disables the macro's error checking, and disables other things like magic initial state. I never use fn except when error checking is mistaken
Fulcro 3.3.0 now has better support for hot code reload when you’re using dynamic queries. This eliminates most needs to hard reload (browser refresh) the app. See http://book.fulcrologic.com/#_hot_code_reload_and_dynamic_queries
TL;DR:
Upgrade to 3.3.0, and add this to your refresh
function that shadow-cljs calls:
(comp/refresh-dynamic-queries! app)
and enjoy fewer presses of CMD-R in chrome 🙂
I’m going to push 3.3.1…I accidentally left a debug logging message in 3.0.0 😕
Fulcro RAD now has another possibility for storage: Key Value stores (in general). The repository is setup as another RAD Demo, just to demonstrate it all working. Please take a look: https://github.com/fulcrologic/fulcro-rad-kvstore
Any thoughts on why after every other key stroke, if I submit this, stashed-text is null in submit-form. Also on this note, for local component state, should I be using an atom or the react local state mechanism? Thanks.
you’re not using update-state!
correctly. If takes a function that gives you the old state, and you return new state…
so you’re walking into your data structure and using the nested data as the new data, which will only work once
Thank you I see!