Fork me on GitHub

Hi. I’m new to Datomic. I have some problems with the Seattle example: The first thing that I don’t understand is why i can execute "(d/create-database uri)” and it returns true (success) and then stop the REPL, restart my computer and then try again and it returns false (like if the database still exists), so I have to execute "(d/delete-database uri)” first. It is an in memory database in the example "(def uri "datomic:<mem://seattle>”)”. I think this is the root of my problem, because what happens next is that I get ”duplicate key” errors when I try to load the data (submit the transaction), like if the data is already there, when I run the whole example again. Any ideas?


Hey all. Has anyone been using Spec-tacular much?


@paulspencerwilliams: well, I have! but I don’t think many other people do haha


@calvis: it looks like a neat DSL.


@calvis: can / would use use the specs as ‘records’ throughout the rest of an application, or keep these contained within a ‘db layer’, and use records or maps across the app?


@paulspencerwilliams: yes we use them throughout, I think the only time we don’t is when we have a required field on the database that isn’t necessarily required off the database. I’d like to add a more precise specification for that type of field


@calvis: and you just use the

functions to create them as needed in controller for example?


Cool. Cheers. Will play. It seemed a little boilerplaty to have both defrecords and defspecs around.


@teng: I tried to re-create the issue you are facing and was unsuccessful. Tell me if I have your steps in correct order: 1. Def the URI 2. d/create the uri 3. C-d (control D or quit the REPL) 4. Restart machine


@teng when I even c-d the Repl I am able to create a new in-memory DB with the same name with no problem.


@teng I also skipped ahead and tried d/deleting the in-memory DB and was able to remove and re-create it and load the schema again


@teng are you sure you are passing in the :mem protocol and not :dev or :free?