Are there any up to date tutorials, books, or courses available for Datomic Pro? I've watched Day of Datomic 2016 (though this was for the Client Library, so it looks like I need to go over Day of Datomic 2014 for the Peer library) and have stumbled through the Datomic docs up to where I have a running transactor backed by Postgres, and am now to the step of trying to connect to it from my separate peer application. It feels like there's a hole in the documentation. It starts out fine, saying how to set up Datomic Pro, but then once the database is created, the examples all fall back to Datomic Dev/Local. The connection strings seem like they may have a different format for sql databases than for local. It's not well explained how to make this transition from local to a true peer. The config/samples/sql-transactor-template.properties has some clues, but commented links to docs are no longer valid. I'm happy to pay for a course or book, and at first this looked great, being titled "Datomic Pro", but looking at the course content, it seems to be named incorrectly as it does not appear to cover Pro at all, only Dev/Local then straight to Cloud: https://www.jacekschae.com/learn-datomic-pro
Got my peer connected to the transactor, thank you for the pointers everyone!
I did not know that even existed!
It still looks good! I was also pointed towards this fantastic online game to help learn Datomic's Datalog: https://max-datom.com/
That looks really neat ... but it has a classic Datomic bug right out of the gate... it seems to assume an order for the query results which makes it randomly claim a solution has failed. Oh well.
@cch1 Where is the bug you believe you have found in max-datom? Are you perhaps on level 3? If so, keep in mind that https://docs.datomic.com/query/query-data-reference.html#find-specshttps://docs.datomic.com/query/query-data-reference.html#find-specshttps://docs.datomic.com/query/query-data-reference.html#find-specs. Is it possible that you are returning [first+last-name eid] instead of entity-id and the value of :author/first+last-name that the problem asks for, and assuming it is query result order that marks it incorrect? That has been a common tripping point for folks in the past.
If there is an actual result ordering bug, I’d like to know and get it fixed.
Here's a screenshot of the error: Note how the results (as far as I could clip for the screen grab) are in the right format with the right (tuple) values returned... but the order is slightly off -and you can see that in the last first+last-name in actual versus expected.
That's ^ all very early in the exercises... #2 if I read it right.
The query you are running isn’t the one expected (although it does produce very similar results 🙂)
You are taking the value of :book/author ?a and using it as the entity to unify :author/first+last-name on which isn’t what the question is asking for.
All you need here is:
(d/q '[:find ?v
:where [_ :author/first+last-name ?v]] db)
I had intended to add another :author that isn’t referenced by a :book to make the different results more obvious. I will add that to my todo list, as it is a reasonable expectation to have the answer be valid, as the results are displayed the same but ordered differently.I think Jacek released that course before we made Datomic Free and thus re-titled Datomic On-Prem as Datomic Pro.
I've shared your feedback with the docs team, and would be interested in pairing or further understanding where you slid into dev/local/cloud examples post creating a DB on sql? I am not surprised as we merged our docs and have a project underway to make the doc examples switch depending on your selection of client/peer apis.
The https://docs.datomic.com/peer-tutorial/peer-tutorial.html is what I would expect to cover the basics.
The connection strings seem like they may have a different format for sql databases.You're correct. Connection strings can be seen by running the transactor with following command line arg: bin/transactor -Ddatomic.printConnectionInfo=true . (see https://docs.datomic.com/operation/system-properties.html#transactor-properties for other args and more info.) And we document the connection strings in our https://docs.datomic.com/clojure/index.html#datomic.api/connect. For Sql they look like: datomic:sql://{db-name}?{jdbc-url}
Scratch that. We do document it. printConnectionInfo=true in https://docs.datomic.com/operation/system-properties.html#transactor-properties
Thank you! I had not found that properties doc, and this will keep me moving forward. I'll retrace my steps and see where I got lost.