This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-06
Channels
- # announcements (3)
- # beginners (83)
- # calva (11)
- # cider (24)
- # cljdoc (2)
- # cljs-dev (1)
- # clojure (216)
- # clojure-berlin (1)
- # clojure-dev (18)
- # clojure-europe (8)
- # clojure-italy (5)
- # clojure-losangeles (2)
- # clojure-nl (4)
- # clojure-spec (34)
- # clojure-uk (75)
- # clojuredesign-podcast (12)
- # clojurescript (33)
- # clojutre (13)
- # community-development (1)
- # core-async (38)
- # cursive (19)
- # datomic (28)
- # duct (3)
- # emacs (1)
- # events (5)
- # figwheel-main (3)
- # fulcro (93)
- # kaocha (20)
- # lambdaisland (2)
- # off-topic (40)
- # pathom (17)
- # pedestal (8)
- # quil (1)
- # re-frame (14)
- # reitit (19)
- # shadow-cljs (34)
- # sql (8)
- # tools-deps (6)
- # vim (1)
- # xtdb (8)
- # yada (18)
@brian.rogers I think you want to look at having an API Gateway proxy
resource and configuring the ion with the API Gateway :integration
, in that way your whole request path will be available in the context
object. I haven’t gotten to revisit ions and API Gateway in months so this is faint memory backed up by a quick review of the docs page.
Re: my problem above--I've taken out all the deps that were easy to take out, but no dice. I'm going to see if I can somehow replace a large-but-important dep I have and hope that works. However, is it possible on the solo topology to upgrade the compute stack to use a larger ec2 instance instead of the default t3.small? (I'm assuming that would fix the issue). I'd upgrade to production topology, except I just can't afford two i3.large instances at the early stage I'm in right now.
Unfortunately, for Solo, you’re stuck with the default option. Try doing some profiling on your code to see what is eating the resources.
I got stuck a bit with the following problem. When shifting a predicate clause inside not
, the query stops working. For example, this query works fine:
[:find ?e ?id
:where
[?e :user/pg-id ?id]
[(< ?id 5)]]
But the second is not:
[:find ?e ?id
:where
[?e :user/pg-id ?id]
(not [(< ?id 5)])]
Of cause I can flip the predicate in such a way so it returns opposite value. But I rather interested in common approach.The error message I’m getting in console is
processing rule: (q__198 ?e ?id), message: processing clause: ["not" [(< ?id 5)]], message: :db.error/invalid-lookup-ref Invalid list form: [(< ?id 5)]
What's a good way of getting secrets up on to datomic cloud? (details here: https://ask.clojure.org/index.php/8554/how-to-store-secrets-in-datomic-cloud)
Thanks @chris_johnson!
I’m trying to deploy a Datomic Ion application and it’s failing in datomic.client.api/client
(creating the client).
{
"Type": "java.lang.AssertionError",
"Message": "Assert failed: cfg",
"At": [
"datomic.client.impl.local$create_client",
"invokeStatic",
"local.clj",
208
]
}
I assume that cfg
implies the configuration map (the one parameter that datomic.client.api/client
accepts) and that AssertionError
implies it doesn’t exist. I have verified that it exists and is valid. The same code works flawlessly from my local machine at the REPL, which is how I understand that Datomic is expecting it (https://github.com/Datomic/ion-event-example/blob/e08c59d0cac1a100251232a462dd77194d83e48a/src/datomic/ion/event_example.clj#L58) even though it swaps out the configuration for the local Datomic client.
Any help on how to proceed through this non-descriptive error from a black box would be most appreciated!Here’s the full CloudWatch trace:
[
"datomic.client.impl.local$create_client",
"invokeStatic",
"local.clj",
208
],
[
"datomic.client.impl.local$create_client",
"invoke",
"local.clj",
205
],
[
"clojure.lang.Var",
"invoke",
"Var.java",
384
],
[
"datomic.client.api.impl$dynarun",
"invokeStatic",
"impl.clj",
24
],
[
"datomic.client.api.impl$dynarun",
"invoke",
"impl.clj",
21
],
[
"datomic.client.api.impl$dynacall",
"invokeStatic",
"impl.clj",
31
],
[
"datomic.client.api.impl$dynacall",
"invoke",
"impl.clj",
28
],
[
"datomic.client.api$client",
"invokeStatic",
"api.clj",
84
],
[
"datomic.client.api$client",
"invoke",
"api.clj",
46
],
[
"datomic.client.api$client",
"invokeStatic",
"api.clj",
76
],
[
"datomic.client.api$client",
"invoke",
"api.clj",
46
]
Thanks Joe! I’m surprised that my searching didn’t find that result before. I’ve already lost a day so hopefully no more!
NP, currently the vase-datomic-cloud interceptor does this connection on ns
load. If you're using it, let me know and I'll send you a rewritten version of the interceptor to fix that issue.
I actually didn’t know about https://github.com/cognitect-labs/vase but I am already using pedestal and datomic so I’ll give it a look.
I was using stuartsierra/component and creating the Datomic client when I started the system on ns
load.
I'd say stick with pedestal and datomic for now. We actually backed off from vase on our project for now until it gets some TLC.
Hey y'all 👋 . I'm curious to hear y'all's opinion about when you would choose to use a Datomic enum as opposed to a keyword. One obvious distinction is that an enum is only suitable for a closed set, but are there other factors you consider? What if you have a closed set in terms of what values can be added at any given time, but expect that set to potentially grow in the future? Thanks!
If not, I've been badly misinformed 😆 https://docs.datomic.com/on-prem/schema.html#enums
Can see how that title is confusing, but the gist is to use :db/ident to model "enum-like" stuff
Mainly because that's the usual convention for enums. And because unless I'm misremembering, you couldn't transact (to use their music DB example)
[<some-entity> :artist/country :country/NONEXISTENT-VALUE]
For your transact "issue", that's not how you model entities in datomic, read this carefully https://docs.datomic.com/cloud/whatis/data-model.html
performance on heterogenous vs homogenous tuples
Say I have a tuple of [type spec]
, where both values are strings. This vector is guaranteed to be length = 2.
I can model this as a homogenous tuple of strings - :db/tupleType :db.type/string
or a heterogenous tuple - :db/tupleTypes [:db.type/string :db.type/string]
I suspect performance+storage will be better on the homogenous tuple. However, the heterogenous tuple more accurately models the data as it forces count = 2. Are these correct assumptions?