spark.spec-tacular.schema
Creating Datomic schemas from specifications
diff
(diff schema1 schema2)
Returns the difference between two schemas as three sets: * the entries only in schema1
, * the entries only in schema2
, * the entries in both schema1
and schema2
from-database
(from-database db)
Returns the Schema in the given Database, Connection, or spark.spec-tacular.datomic/ConnCtx.
from-specs
(from-specs specs)
Converts a sequence of specs (which may be actual spec objects or keywords) into a Schema
InstallableEntityMap
A a full description of a Datomic entity that can be installed as part of a Datomic schema.
normalize
(normalize schema)
Normalizes schema
for comparison:
- removes any mappings for attributes that Datomic adds automatically
- removes
:db/id
and:db.install/_attribute
attributes from each mapping - ensures each entry has a
:db/unique
attribute, even if it’snil
- simplifies
:db/fn
fields so that they are comparable with=
Schema
A list of mappings that can be used as a Datomic schema. Schemas can be created from sequences or namespaces containing defspecs, or can be recreated from files and databases.
spec-tacular-map
The map for the special :spec-tacular/spec
ident which must be installed on any database hoping to use spec-tacular. Automatically installed when using to-database!.
to-database!
(to-database! schema)
(to-database! schema uri)
Creates a fresh database with schema
installed and returns a connection to that database. If the schema does not already contain spec-tacular-map, it is added.
Installs at uri
if supplied.