Question

How do I add isComponent to a Datomic attribute using the Datomisca library?

In Datomic, I would do the following:

{:db/id :person/favorite-food
 :db/isComponent true
 :db.alter/_attribute :db.part/db}
Was it helpful?

Solution

Unfortunately, I haven’t had time to add full support for schema alteration in Datomisca.

However, schema alteration is no different to any other transactions, so there should be no issue with building the transaction data that you describe above.

Entity.add(Namespace("person") / "favorite-food") (
  Attribute.isComponent -> true,
  Namespace("db.alter") / "_attribute" -> Partition.DB
)

What Datomisca is lacking is http://docs.datomic.com/javadoc/datomic/Connection.html#syncSchema(long)

But a datomisca Connection is just datomic Connection, so you can still access that underlying API. I will endeavor to add the new sync APIs in the near future.

For future reference, the google group is a good place to ask questions like these, as I’m more likely to notice them (a colleague noticed your question). https://groups.google.com/forum/?fromgroups#!forum/datomisca

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top