Closed alex-dixon closed 7 years ago
Suggest rename defsession
's :schema option to :db-schema
and add :client-schema
.
Client schema could be Datomic-style schema or our own syntax. Which we choose seems less important than implementing support for the feature as others will be able to conform any schema definition to what we expect to receive.
The simplest expression would be [[:attr :one-to-many] [:attr :unique-identity] [:attr unique-value]]
. That may make it cumbersome to expand in the future, say if we wanted to support more schema enforcement than just uniqueness and cardinality, e.g. component or even types.
A map syntax offers greater flexibility:
{:attribute :my-attribute
:cardinality :one-to-many}
Compared to Datomic's:
{:db/partition :db.part/user
:db/ident :my-attribute
:db.cardinality :db.cardinality/one-to-many}
Added #63
Starting assumptions:
[1 :some-list "a"] [1 :some-list "b"]
).Assuming the above, proposing def-tuple-session receives a list of one-to-many attributes.