This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-20
Channels
- # admin-announcements (1)
- # announcements (9)
- # aws (11)
- # babashka (33)
- # beginners (125)
- # calva (20)
- # cider (18)
- # clj-kondo (7)
- # cljs-dev (73)
- # clojure (72)
- # clojure-europe (18)
- # clojure-italy (13)
- # clojure-nl (13)
- # clojure-uk (9)
- # clojurescript (22)
- # core-async (7)
- # cursive (1)
- # data-science (25)
- # datomic (22)
- # duct (32)
- # emacs (13)
- # graalvm (5)
- # hoplon (16)
- # juxt (6)
- # kaocha (8)
- # leiningen (3)
- # malli (11)
- # meander (12)
- # off-topic (18)
- # pathom (109)
- # pedestal (5)
- # rdf (10)
- # reagent (1)
- # reitit (12)
- # shadow-cljs (27)
- # spacemacs (5)
- # sql (9)
- # tools-deps (7)
@favila Quick question. How do I start the datomic UI console. This is the URI from my transactor
datomic:
I frist tried starting the peer server by running
bin/run -m datomic.peer-server -h localhost -p 9001 -a myaccesskey,mysecret -d helloo,datomic:
Then next I ran
bin/console -p 8084 helloo datomic:
to start the console, the UI opens. but when I choose DB, I get this error
java.lang.RuntimeException: Could not find hello//hello in catalog
note, the alias here is not a db alias, but a “storage” alias (i.e. all the dbs managed by a transactor)
Thank you so much 🙂
Is there an easy way to construct the where clause for a query? Like conditionaly i want this where clause or this one.
gotcha. I was trying to remember how programmatic queries worked. https://docs.datomic.com/on-prem/query.html#building-queries-programmatically
The other options you mentioned might work to for my case.
in general you want static queries https://docs.datomic.com/on-prem/best-practices.html#parameterize-queries
but not always. ad-hoc filters is one case where it’s just easier and more predictable performance to add/remove clauses
@drewverlee you want backtick https://github.com/brandonbloom/backtick
(let [needle "foo"]
(template
[[(clojure.string/includes? ?name ~needle)]]))
=> [[(clojure.string/includes? ?name "foo")]]
Yes be sure that you aren’t blowing out number of static queries, parameterize them appropriately if possible, injecting a string constant in this way would be a really bad idea, but injecting a clause based on a predicate would be fine as it emits only two possible queriesWhat i feel i need to express is the idea of conditionally picking the part of the where clauses. d/q [:find ?x :where [?a :fname "drew"] (if some-conditional [?a :lname "verlee"] [?a :age 15] I think i need to insert the entire clause(s) as opposed to just an entity, attribute or value.
is this because you have a multiparameter search interface, and some fields can be unused?
Just wondering what your use case is. What you wrote here is possible but not the best--parameterization is better; conditionally emitting clauses can sometimes be ok but still using parameterization
@drewverlee you want backtick https://github.com/brandonbloom/backtick
(let [needle "foo"]
(template
[[(clojure.string/includes? ?name ~needle)]]))
=> [[(clojure.string/includes? ?name "foo")]]
Yes be sure that you aren’t blowing out number of static queries, parameterize them appropriately if possible, injecting a string constant in this way would be a really bad idea, but injecting a clause based on a predicate would be fine as it emits only two possible queries