This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (8)
- # announcements (1)
- # boot (343)
- # braid-chat (23)
- # cider (20)
- # clara (5)
- # cljsrn (48)
- # clojars (5)
- # clojure (90)
- # clojure-canada (3)
- # clojure-czech (1)
- # clojure-russia (107)
- # clojure-sg (2)
- # clojurebridge (2)
- # clojured (10)
- # clojurescript (70)
- # community-development (73)
- # cursive (106)
- # datavis (40)
- # datomic (40)
- # docs (4)
- # editors (1)
- # emacs (1)
- # events (4)
- # funcool (2)
- # hoplon (46)
- # jobs (2)
- # ldnclj (11)
- # mount (8)
- # om (214)
- # onyx (12)
- # re-frame (35)
- # reagent (31)
- # spacemacs (12)
- # yada (18)
Hi. Are there any migration tools for Datomic? Say, I'm in development and I'm changing my schema arbitrarily, and I want to preserve all the data though?
@andrewboltachev: I’ve been using https://github.com/rkneufeld/conformity for that (I’m a newbie though)
No prob. Seems to cover most of what I was using lobos for in pgsql-world. There are a few other similar tools around if you google a bit
Main problem is Datomic's support around schema changes, e.g. fulltext attribute once it's set
@timgilbert: so, would that library, say help me to (1) take all the data (2) drop existing and create a new schema (3) import preserved data, and apply transformations to it where appropriate?
It just basically lets you run a set of transactions on your database, and then it keeps track of which ones have already been run
But as I understand it, you don’t really drop old schema changes, since everything is immutable
So transactions can include schema updates, and oalso adding new data from somewhere
My real situation is like this: (0) I have an idea about an (web) app I want to build (1) I'm starting to with "categories". And I want to have schema to save categories and make categories widgets first (2) I realize that there would be "collapsed" flag for each category (in category widget, is it collapsed or not) — need to add new attribute (3) I'm finished with the widget and I want to add "items" entity. (4) Adding users to my project (5) Say, categories list (or tree, or graph ['cause yep, there's no tree]) is common for all users, but each has own ones collapsed-or-not. So, thus "collapsed" flag must be turned to some relation then. Could I achieve (5) (and all of the above) without creating new DB?
Also, interesting thing is that this way of development I just described is sort of "Agile", i.e. categories, items and users are "features". According to Rich Hickey we should be solving problems, not building features. So, is my way fundamentally incorrect, i.e. I should first imagine what my app would operate (design it) and then implement it (so no changes to DB like that would arise)? Would much appreciate any answers/opinions.
@andrewboltachev: hey andrew- definitely don't go in the "waterfall" direction of having heavy "design" and "implementation" cycles. instead, tune your workflow to make it easy to try, discard, and try again. use datomic in mem mode, or even datascript, to iterate on a data model, and separately, if you need to "seed" your data model to test your app, keep the seed datoms in an edn file and just transact them at app startup
@jonahbenton: so, you say I'll be able to switch to Datomic when finally ready to production?
One big thing is confidence, though. Whoever said that building and deploying an app must not be harder than in 1-click.
yes, you can use Datomic in a "disposable" mode as you iterate through design and implementation, and even when you first show it to users in 1-on-1s. getting positive user feedback, and being comfortable with your feature set, helps build confidence. when you have confidence to capture user data durably, then you can switch Datomic to a durable storage
but you don't want to saddle yourself with unnecessary workflow obstacles while getting to that place, because then you will lose momentum
Well, seems I have an idea (and some thesis) for a library (but I'll probably build it for SQL, at least first). 'Cause migrations is what I missed in Clojure world, when switching from Python/Django. Thanks for help @jonahbenton ! I'll take into account what you've answered
Is there a way to specify inside a
:where clause that a the number of
?things must be more than a given number, e.g.
(> (count ?things) 6) ?
@sdegutis: if you want to get it done in a single query, you can do so with a subquery, as in this example: https://groups.google.com/d/msg/datomic/5849yVrza2M/31--4xcdxOMJ
main use case (at least re: performance) is REST, on JVM may be as or more efficient to just chain query results into another query or sequence manipulation.
I’d say only mildly hacky, maybe the fully qualified namespace stands out a little : ) It is a use case it’s designed to support. I.e., chaining queries together or using subquery are both means of composing queries. Composing queries is one reason datalog query in Datomic takes in a set of relations and returns a set of relations as its default (when return not overridden by find specification).
Hmm, I wonder if it can be cleaned up using that function-storing feature Datomic has.
Does anyone have an example of querying the Datomic Rest API through clojure, I can't figure out how to do it...
If I try something like that ^ it just gives me an error because of the formatting of all the ?eid fields