This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-23
Channels
- # announcements (26)
- # babashka (8)
- # babashka-sci-dev (3)
- # beginners (93)
- # biff (44)
- # calva (1)
- # cider (7)
- # clj-kondo (13)
- # cljdoc (1)
- # clojure (121)
- # clojure-australia (2)
- # clojure-europe (18)
- # clojure-nl (1)
- # clojure-norway (5)
- # clojure-uk (1)
- # clojurescript (35)
- # conjure (1)
- # core-async (2)
- # datalevin (6)
- # datomic (28)
- # emacs (25)
- # events (1)
- # fulcro (5)
- # introduce-yourself (2)
- # jobs (8)
- # leiningen (2)
- # off-topic (13)
- # other-languages (1)
- # podcasts-discuss (1)
- # polylith (7)
- # rdf (6)
- # re-frame (1)
- # reagent (53)
- # releases (3)
- # rewrite-clj (7)
- # scittle (5)
- # shadow-cljs (63)
- # specter (1)
- # squint (5)
- # tools-build (5)
- # xtdb (7)
For REPL development when using dev-local with durable data, how can one use attribute predicates? I am getting "Unable to load namespace for..." errors.
@U70QFSCG2, hey, were you able to make this work? I now face the same issue, while all namespaces with predicates were required and loaded.
Yeah, I believe everything is fine with the symbol and its quoting. I managed to move a bit further though.
I’ve included datomic/ion-config.edn
to my project’s resources because, as it turns out, all such predicates must be explicitly listed as allowed there (even if you’re not developing an Ion).
This helped to resolve the previous error, but I now face another one:
Execution error (ExceptionInfo) at datomic.ion.resolver/anomaly! (resolver.clj:41).
''grossbuchbot.db-queries.datomic.entity-preds/valid-chat?' needs to be listed under :allow in datomic/ion-config.edn
My ion-config.edn
looks like this:
{:allow [grossbuchbot.db-queries.datomic.entity-preds/valid-chat?
grossbuchbot.db-queries.datomic.entity-preds/valid-chat-data?
grossbuchbot.db-queries.datomic.entity-preds/matching-data-exists?]
:app-name "<the_same_system_that_is_diverted_locally>"}
So far I’ve managed to check that:
• the ion-config.edn
file is actually picked up — whenever I move it or rename, I receive the previous error:
Execution error (ExceptionInfo) at datomic.core.require/anomaly! (require.clj:53).
Unable to load namespace for 'grossbuchbot.db-queries.datomic.entity-preds/valid-chat?
• replacing specific symbols in :allow
vector with a wildcard doesn’t help — put grossbuchbot.db-queries.datomic.entity-preds/*
, received the same error ''grossbuchbot.db-queries.datomic.entity-preds/valid-chat?' needs to be listed under :allow in datomic/ion-config.edn
Yeah, I reflected whatever was in the https://docs.datomic.com/cloud/schema/schema-reference.html#entity-predicates:
{:db/ident :chat/validate
:db.entity/attrs [:chat/id :chat/type]
:db.entity/preds 'grossbuchbot.db-queries.datomic.entity-preds/valid-chat?}
Will try dropping this '
now, one sec.if it’s code (e.g. a def in a ns) it should be quoted; if it’s slurped out of an edn file, it shouldn’t be
Thank you Francis*!* It would be great, if the schema reference could be updated with this minor but crucial detail. Something along the lines of:
in cloud how is a with-db different than a db, can I just always use with-db ?
in on-prem, that db is just a db object with extra novelty on it; but in cloud it has to be retained by the server and you get a reference to it
this also means you need to ensure session-stickiness, and you might lose access to it
oddly there’s no explicit resource management so I have no idea how you release it or when it is released.
oh because in cloud the with-db is remote from the app, so you have to move the speculative txn from app to query server and hopefully only once
thank you