datomic

Datomic throws ActiveMQInternalErrorException when connecting to restored database

China☆狼群 提交于 2021-02-20 02:21:40
问题 I backed up a Datomic v0.9.5786 database from :dev storage: ~/datomic/datomic-pro-0.9.5786/bin/datomic -Xmx4g -Xms4g backup-db datomic:dev://localhost:4334/acct file:/Users/petrus/acct.datomic Copied 0 segments, skipped 0 segments. Copied 414 segments, skipped 0 segments. :succeeded Restoring the backup to a newer version of Datomic Pro v1.0.6202 on my othre laptop apparently succeeds: ➜ datomic-pro-1.0.6202 bin/datomic -Xmx4g -Xms4g restore-db file:/Users/petrus/Projects/acct/resources/data

Datomic throws ActiveMQInternalErrorException when connecting to restored database

女生的网名这么多〃 提交于 2021-02-20 02:17:26
问题 I backed up a Datomic v0.9.5786 database from :dev storage: ~/datomic/datomic-pro-0.9.5786/bin/datomic -Xmx4g -Xms4g backup-db datomic:dev://localhost:4334/acct file:/Users/petrus/acct.datomic Copied 0 segments, skipped 0 segments. Copied 414 segments, skipped 0 segments. :succeeded Restoring the backup to a newer version of Datomic Pro v1.0.6202 on my othre laptop apparently succeeds: ➜ datomic-pro-1.0.6202 bin/datomic -Xmx4g -Xms4g restore-db file:/Users/petrus/Projects/acct/resources/data

Datomic many to many with data on the relationship

蹲街弑〆低调 提交于 2021-01-29 13:59:20
问题 I'd like to implement a many to many relationship which also has metadata describing the relationship. One could think of the relationship as a labelled edge. Specifically, a path consists of an ordered collection of series, and a series can be within more than one path, on each occasion having a position within such path. If I understand correctly some reification of the relationship is needed in datomic (as we cannot label edges directly), such as a join entity like: :path/path-member ; ref

How to represent pivot table (with extra data on it) in datomic?

 ̄綄美尐妖づ 提交于 2020-06-01 05:29:09
问题 I realise that we don't need ordinary pivot tables in datomic because we can just pick one side of the relationship and put a :db.cardinality/many attribute on there (being sure to model the relationship in one direction only). The next thing I encounter in converting from sql is a pivot table that also stores an attribute on the relationship, like: series_subscriptions user_id int series_id int expires_at timestamp I was wondering what the options are to model this in datomic. I notice there

Clojure call series of functions and store their return values

帅比萌擦擦* 提交于 2020-05-15 09:33:07
问题 I'm building a datomic schema and have the following at the foot of my clj file which defines and transacts schema and initial data. The functions being called below each call d/transact . (defn recreate-database [] "To recreate db after running delete-database in bin/repl" (pt1-transact-schema) (pt1-transact-data) (pt2-transact-schema) (pt2-transact-data) (pt3-transact-schema) (pt3-transact-data)) By default we only see the return value of the last form, but I'd like to see, or save, the

modelling multiple many-to-many relationships in datomic

こ雲淡風輕ζ 提交于 2020-01-12 04:59:09
问题 Maybe I'm still thinking sql but I'm having trouble writing the datomic schema for a simple blog. I don't really understand the :db/cardinality attribute and what it means. In terms of this type of system, how do we model these relationships The system supports multiple users Each user may have many categories Each user may have many articles Each category may have many users Each category may have many articles Each article may have many comments Each comment has one user 回答1: Look at the

Datomic aggregates usage

风流意气都作罢 提交于 2019-12-24 14:13:16
问题 I want to find persons with minimal age with next query (d/q '[:find ?name (min ?age) :in [[?name ?age]]] [["John" 20] ["Bill" 25] ["Jack" 20] ["Steve" 28] ["Andrew" 30]]) But result is [["Andrew" 30] ["Bill" 25] ["Jack" 20] ["John" 20] ["Steve" 28]] How to do that? 回答1: Instead of chaining the queries together, you could use a subquery (query call from within the query instead of outside of it): (d/q '[:find ?name ?mage :in $ :where [(datomic.api/q '[:find (min ?age) :where [_ :age ?age]] $)

How can I use Datomic Pro on Heroku?

风格不统一 提交于 2019-12-23 11:53:36
问题 I'd like to use Datomic Pro (Starter Edition, for now) on Heroku. But I don't want to commit my download key into Git. Instead, the right thing to do would seem to be store it in an environment variable. That means my project.clj now contains: :dependencies [[org.clojure/clojure "1.5.1"] [com.datomic/datomic-pro "0.9.4707"]] :repositories {"my.datomic.com" {:url "https://my.datomic.com/repo" :username ~(System/getenv "DATOMIC_EMAIL") :password ~(System/getenv "DATOMIC_KEY")}} I've set DATOMIC

Updating transaction in Datomic for an attribute that has many cardinality

南楼画角 提交于 2019-12-22 11:27:51
问题 I have searched for two days and haven't seen any code that is closed to this. This is the only code in java that I seen and it's not exactly what I wanted. conn.transact(list(list("db.fn/cas", datomic_id, "attribute you want to update", old value, new value))).get(); I have tried this code with a single value in the old value and a single value in the new value but it just stack the information instead of overlaying it. Example: old value is chicken and new value is fish. After the

qualified relationships in datomic

风流意气都作罢 提交于 2019-12-22 04:37:12
问题 In a relational DB, I could have a table Person and a table Hobby . Every person can have zero, one or more hobbies , and I also want to record, say, the priority of those hobbies for every person . I could create a relationship table with the 2 foreign keys PersonFK and HobbyFK , and one plain column Priority . In datomic, to model a simple n:m relationship (without the priority), I'd probably create an attribute of type Reference with cardinality Many , that I'd use for Person entities. But