Fork me on GitHub
#beginners
<
2024-05-22
>
Bennet Carpenter14:05:50

As a beginner I'm curious about the benefits of using Datomic with Clojure versus a SQL database. I recognize my familiarity bias. In my small corner of the JavaScript world I had never heard of Datomic until I started learning Clojure. Is Datomic often used in production Clojure projects? Or is SQL still the overwhelming standard?

Alex Miller (Clojure team)15:05:37

Both are common. I don't think there is any data sample that actually answers this question though.

phill15:05:13

You may with a clear conscience separate the two questions. NoSQL with Datalog is a very splendiferous thing (relative to SQL). And Clojure is a very splendiferous thing (relative to you-name-it). In fact, Clojure is so splendiferous that you might be astonished how easy SQL is, with plain unvarnished JDBC that you would find awful clunky in Java. Look for examples using resultset-seq. No need to slay all dragons at once.

Drew Verlee15:05:16

@U06QGV6BVHV if you want to jump on a slack call i can try to answer some of your questions.

Bennet Carpenter16:05:23

@U0DJ4T5U1 That's really generous! I'm available

seancorfield16:05:48

Another option to consider -- although it's still prerelease right now -- XTDB v2 is a bitemporal database in the same vein as Datomic that has full support for SQL even tho' it is a columnar database under the hood (built on Apache Arrow). It's both free and open source, and built in Clojure by the Juxt folks. I'm also happy to chat about #C1Q164V29 in Clojure since I maintain both clojure.java.jdbc (the old Contrib lib) and next.jdbc (the next-gen version of that), and also HoneySQL for turning Clojure data structures into SQL (so you have a composable DSL for SQL).

Nim Sadeh16:05:54

I am trying to use Alembic to add dependencies to my project without restarting the repl. I am not sure I am following the instructions correctly. I added alembic to my profiles file and can now use it in the project. I added a dependency to my project.clj file, and then wrote and executed the following comment form:

(comment (require '[alembic.still :refer [load-project])
         (load-project "project.clj")
) 
However, I am still not able to import my new dependency (clj-http 3.13.0, if it matters).

Troy21:05:45

I'm trying to use clj-async-profiler and have this added in my deps.edn

:aliases {:jvm-opts ["-Djdk.attach.allowAttachSelf"]}
what does it mean to 'enable that alias'? include it in the 'require' in the namespace?
(ns my-name-space (:require [jvm-opts]))
for example?

respatialized22:05:15

you won't need to do anything in the namespace: those options are passed to the JVM, which means they are already applied when the JVM starts up. first, you need a key to define a name for that alias: :jvm-opts is an entry in the map for a given alias. for example:

:aliases {:profiler {:jvm-opts ["-Djdk.attach.allowAttachSelf"]}}
enabling an alias means adding it to the list of options passed to the clojure CLI (see https://clojure.org/reference/clojure_cli#aliases). so instead of clojure -M -m my-main-fn it would be clojure -M:profiler -m my-main-fn.

👍 1
phronmophobic22:05:25

Most IDEs have an option for which aliases to include when the repl is started.

1
👍 1
Troy23:05:06

Thanks, that got it working in REPL.