문제

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}
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top