Skip to content

A minimal abstraction for defining domain models and even domain model specs themselves - quite meta ...

License

Notifications You must be signed in to change notification settings

thosmos/domain-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thosmos/domain-spec

Clojars Project

A minimal abstraction for defining domain models and even domain model specs themselves - quite meta ...

Usage

  • Define a spec.edn something like:
[{:db/id         "person",
  :db/ident      :thosmos.entity.spec/person
  :entity/name   "person",
  :entity/ns     :thosmos.entity.ns/person,
  :entity/attrs  [#:attr{:name        "id",
                         :key         :person/id,
                         :cardinality :one,
                         :type        :long,
                         :identity    true}
                  #:attr{:name        "name",
                         :key         :person/name,
                         :cardinality :one,
                         :type        :string}
                  #:attr{:name "books"
                         :key   :person/books
                         :cardinality :many,
                         :type  :ref
                         :ref :thosmos.entity.spec/book}]}
 {:db/id         "book",
  :db/ident      :thosmos.entity.spec/book,
  :entity/name   "book",
  :entity/ns     :thosmos.entity.ns/book,
  :entity/attrs  [#:attr{:name        "id",
                         :key         :book/id,
                         :cardinality :one,
                         :type        :long,
                         :identity    true}
                  #:attr{:name        "name",
                         :key         :book/name,
                         :cardinality :one,
                         :type        :string}]}]

then use the various functions to convert into terse, datomic, or datascript schema

License

Copyright © 2018 Thomas Spellman

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

A minimal abstraction for defining domain models and even domain model specs themselves - quite meta ...

Resources

License

Stars

Watchers

Forks

Packages