This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-06
Channels
- # announcements (69)
- # aws-lambda (3)
- # babashka (45)
- # beginners (28)
- # calva (4)
- # clara (7)
- # clojure (23)
- # clojure-spec (5)
- # clojure-uk (18)
- # clojurescript (57)
- # clojutre (1)
- # cursive (20)
- # datomic (31)
- # emacs (5)
- # figwheel-main (3)
- # fulcro (16)
- # graalvm (7)
- # luminus (4)
- # nrepl (9)
- # off-topic (50)
- # re-frame (8)
- # reitit (2)
- # rewrite-clj (10)
- # shadow-cljs (88)
- # spacemacs (1)
- # sql (6)
- # vim (2)
Looking at https://aws.amazon.com/marketplace/pp/Cognitect-Inc-Datomic-Cloud/prodview-otb76awcrb7aa it seems that in the Fullfillment Options
section each option is duplicated. I'm wondering why is that 🙂.
We’re working with AWS to correct this, but with the recent release they duplicated the listing. One option is the most recent release and the other is all previous. We’re working with them to correct this so they roll up.
Has anyone been making use of the newer entity predicates and attribute constraints? I’m doing some data modeling and am curious how others have been using these features, and also how they might integrate with spec.
is this call supposed to work: (d/transact conn {:tx-data [{:db/doc "hello world"}]})
? docs suggest that second arg should be a list of lists
did anybody get ClassNotFoundException about org.eclipse.jetty.util.thread.ThreadPoolBudget? just trying to connect to peer server
ugh.. these docs are quite outdated https://docs.datomic.com/on-prem/project-setup.html
I seem to be having this problem but can’t figure out a solution. Any ideas? https://forum.datomic.com/t/issue-retrieving-com-datomic-ion-dependency-from-datomic-cloud-maven-repo/508/5
Hi. Have you tried setting your creds by sourcing a file with the following?:
aws_access_key_id=<access-key-id>
aws_secret_access_key=<secret-access-key>
Could you try to explicitly export them in the terminal you’re using to push as a test to confirm that the env vars are in that terminal
@U5136PEE6 The credentials you source need the ability to be able to read S3. Can you confirm your credentials being sourced have s3 permissions?
i’ve tried specifying a server in m2 settings but that doesn’t help either unfortunately
furthermore i’ve tried creating an s3 bucket with the datomic pom it is having difficulty getting to in my own s3 in the same path and it still is unable read artifact
well, even making my bucket public doesn’t solve the issue. I’m guessing it is something other than aws permissions. I seem to be on clojure 1.10.0
well, i got it working by manually creating directories in .m2/repositories and using aws cli to manually download the files. :man-shrugging: if this ever gets close to prod i’ll revisit this
I have a field with cardinality
set to many
. Having the ID of the parent entity, Can I filter to get only the child entities that pass some rule? For example:
[;; person schema
{:db/ident :person/cars
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/many}
{:db/ident :person/name
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
;; cars schema
{:db/ident :cars/model
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}
]
Imagine the data inside the database:
[{:db/id "A"
:person/name "Bart"}
{:cars/model "Model1"
:person/_cars "A"}
{:cars/model "Model1"
:person/_cars "A"}
{:cars/model "Model2"
:person/_cars "A"}]
I have only the name "Bart" and "Model2" at hand. I want to get back
only the fields {:person/name "Bart" :person/cars {:cars/model "Model2"}}
Ah, after starting to write the query, I realised what your problem was and my previous answer doesn't solve it. That said, you could simply write a rectangular query and transform the values after the fact.
Sure, you would want to write a query that finds all entities with a :cars/model
attribute with a value of "Model2"
, then use that to find the parent entity with a
• :person/cars
attribute with a value that matches the first entity you found
• :person/name
attribute with a value of "Bart"
I imagine there's more data that you would want to retrieve besides {:person/name "Bart" :person/cars {:cars/model "Model2"}}
since you stated that you have both "Bart" and "Model2" at hand. Here's an example query:
(d/q '[:find ?name ?model
:in $ ?name ?model
:where
[?car :cars/model ?model]
[?person :person/cars ?car]
[?person :person/name ?name]]
db
"Bart"
"Model2")
You would take the result of that query, and transform it into the shape that you need it to be in, so if you wanted to get back something like {:person/name "Bart" :person/cars {:cars/model "Model2"}}
(let [query-result [["Bart" "Model2"]]]
(first (map (fn [[name model]]
{:person/name name :person/cars {:cars/model model}})
query-result)))
=> #:person{:name "Bart", :cars #:cars{:model "Model2"}}
Or using :keys
,
(first (map (fn [{:keys [person/name cars/model]}]
{:person/name name :person/cars {:cars/model model}})
(d/q '[:find ?name ?model
:keys person/name cars/model
:in $ ?name ?model
:where
[?car :cars/model ?model]
[?person :person/cars ?car]
[?person :person/name ?name]]
db
"Bart"
"Model2")))