add-ents
takes an ent db as an argument:{:schema schema}
is used, rather than just directly passing in schema
; why don't we just write this?add-ents
is an ent db is so you can take the return value of add-ents
and pass it in as the first argument to further calls to add-ents
:add-ents
are additive; they will never alter existing ents, and will only add new ents. The first call, (sm/add-ents {:schema schema} {:topic [[1]]})
, produces a :topic
named :t0
referencing a :user
named :u0
::t1
and :t2
. :t1
references the existing user, :u0
, and :t2
references a new user from the :refs
, :hamburglar
. When progressively generating an ent-db, you can expect Specmonstah to behave as if all queries were passed as a single query to a single call of add-ents
.:refs
query option.