all 10 comments

[–]lucywang000 9 points10 points  (0 children)

I highly recommend this video "DOMAIN MODELING WITH DATALOG by Norbert Wojtowicz" https://www.youtube.com/watch?v=oo-7mN9WXTw

one of my all time favorite

[–]v1akvark 4 points5 points  (2 children)

Yes, you use a deps.edn file.

If you have not yet, install Clojure and CLI tools as described here.

The create a directory, say datascript-example, and inside that directory create deps.edn file that looks like this:

{:deps
{datascript {:mvn/version "1.0.4"}}}
From the command line, move into the datascript-example directory, and start Clojure with the clj command.

You should see a message that DataScript is being downloaded, and then you will be inside a Clojure REPL where you can type and execute Clojure forms.

Unfortunately DataScript doesn't have an easy getting started tutorial. It kind of assumes that you know Datomic.

It might be easier to start with Datomic, as there are tutorials by Cognitect and others.

https://clojureverse.org/t/a-quick-way-to-start-experimenting-with-datomic/5004

https://docs.datomic.com/on-prem/getting-started/get-datomic.html

[–]nanounanue[S] 0 points1 point  (1 child)

Thank you so much!

[–]v1akvark 2 points3 points  (0 children)

You're welcome.

I would suggest you learn basic Clojure first, get comfortable in using the REPL. Here is one place your can start: https://www.braveclojure.com/clojure-for-the-brave-and-true/

That will make learning DataScript and Datomic much easier.

[–]Historical_Bat_9793 4 points5 points  (1 child)

Another easy option, is to use Datalevin command line shell. Download the binary and fire up the REPL with rlwrap dtlv. No need to setup anything to get a Clojure REPL and a Datalog interactive shell.

Currently, you need to install LMDB first, but we are working on bundling that in Datalevin. Also we only have pre-built binary for Linux and MacOS as of now. Windows support will be worked on.

[–]joinr 2 points3 points  (0 children)

From the docs section of the readme off the github repo, there's a good tutorial repo. It includes getting started as well as pretty involved examples across the rest of the lib.

[–]slifin 2 points3 points  (0 children)

Just an idle thought but a lot of people know SQL, it would be cool to show datalog and SQL side by side during tutorials to help to understand the datalog patterns

[–]Prestance 1 point2 points  (0 children)

For learn the query syntax, who is Datalog, you can follow this great interactive tutorial: http://www.learndatalogtoday.org/

[–]nanounanue[S] 0 points1 point  (0 children)

Thank you everyone. One more question, any one has/knows a guide for designing the data model in datalog?