This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-17
Channels
- # announcements (1)
- # asami (3)
- # babashka (10)
- # beginners (61)
- # calva (60)
- # clojure (47)
- # clojure-nl (3)
- # clojure-uk (10)
- # clojurescript (36)
- # conjure (18)
- # cursive (4)
- # datomic (25)
- # fulcro (21)
- # luminus (1)
- # malli (25)
- # off-topic (26)
- # pathom (2)
- # portal (55)
- # re-frame (1)
- # reagent (7)
- # sci (1)
- # shadow-cljs (25)
- # sim-testing (2)
- # sql (14)
- # vim (6)
- # xtdb (10)
I have a query that looks like this .
'[:find ?r
:in $ ?c [?cur-r ...]
:where
[?c ::rs ?r]]
I'd like to restrict ?r to be all ?r's that are not in ?cur-r. Is there a way to do this?I could make ?cur-r a data source but that requires me to have ?cur-r db ids for cur-r. Currently only have a list of lookup refs.
'[:find ?r
:in $ $cur-r ?c
:where
[?c ::rs ?r]
(not [$cur-r ?r])]
Maybe (not [(identity ?cur-r) ?r])
works
I may just have to convert the ?cur-r lookup refs to eids. Not a big deal but it seems like there should be a way to make this happen in a single query 🙂
Perhaps. Not documented though: https://docs.datomic.com/client-api/datomic.client.api.html
Ah, that seems like it’d work! Will try it in a bit. Thanks @U09R86PA4
As a rule [[(entid [?x] ?eid)[(vector? ?x)]...] [(entid [?x] ?eid) [(int? ?x)][(identity ?x) ?eid]]
and a keyword case looking up ident
Hi, does anyone know how to solve this problem?
bin/transactor config/dev-transactor-template.properties
Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50
Starting datomic:sql://<DB-NAME>?jdbc:, you may need to change the user and password parameters to work with your jdbc driver
...
System started datomic:sql://<DB-NAME>?jdbc:, you may need to change the user and password parameters to work with your jdbc d
river
Terminating process - Lifecycle thread failed
java.util.concurrent.ExecutionException: org.postgresql.util.PSQLException: ERROR: relation "datomic_kvs" does not exist
Position: 31
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$future_call$reify__8454.deref(core.clj:6974)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at datomic.lifecycle_ext$standby_loop.invokeStatic(lifecycle_ext.clj:42)
at datomic.lifecycle_ext$standby_loop.invoke(lifecycle_ext.clj:40)
at clojure.lang.Var.invoke(Var.java:384)
at datomic.lifecycle$start$fn__28718.invoke(lifecycle.clj:73)
at clojure.lang.AFn.run(AFn.java:22)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "datomic_kvs" does not exist
Position: 31
this is my config/properties...
protocol=sql
host=localhost
port=4334
sql-url=jdbc:
sql-user=datomic
sql-password=datomic
sql-driver-class=org.postgresql.Driver
I solve this problem running
CREATE TABLE datomic_kvs (id text NOT NULL, rev integer, map text, val bytea, CONSTRAINT pk_id PRIMARY KEY (id)) WITH (OIDS = FALSE);
ALTER TABLE datomic_kvs OWNER TO datomic; GRANT ALL ON TABLE datomic_kvs TO datomic; GRANT ALL ON TABLE datomic_kvs TO public;