This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-27
Channels
- # admin-announcements (1)
- # aws-lambda (2)
- # beginners (48)
- # boot (231)
- # capetown (1)
- # cider (35)
- # cljs-dev (25)
- # cljsrn (74)
- # clojure (273)
- # clojure-austin (2)
- # clojure-berlin (5)
- # clojure-hk (1)
- # clojure-poland (1)
- # clojure-russia (50)
- # clojure-spec (63)
- # clojure-uk (58)
- # clojurescript (51)
- # cursive (5)
- # datomic (39)
- # defnpodcast (3)
- # dirac (13)
- # editors (6)
- # emacs (3)
- # hoplon (86)
- # jobs (2)
- # lein-figwheel (1)
- # liberator (3)
- # off-topic (10)
- # om (113)
- # onyx (34)
- # protorepl (29)
- # re-frame (2)
- # reagent (8)
- # remote-jobs (1)
- # ring (4)
- # test-check (42)
- # untangled (31)
- # yada (2)
when sorting a list of entities by an attribute … is there a way to read from the sorted index (well, is there a sorted index?) … or just query entity-id and attribute-value and sort in memory?
well, AEVT and AVET are sorted by attribute... you could use one of those. The doc page on Datomic has a good description of how the different indices are laid out: http://docs.datomic.com/indexes.html
hi all, is anyone familiar with a way to incorporate a recursive search into a query? I know that there is the …
symbol for recursion in pull syntax, but I’m not seeing anything in the query grammar. Right now I’m resorting to writing recursive rules, which are kind of brutal:
'[[(item-for-subitem ?item ?sub)
(or-join [?item ?sub]
[?item :item/subitem ?sub]
(and
(item-for-subitem ?item ?mid)
[?mid :item/subitem ?sub]))]]
@ethangracer: recursive rules is the way to go I think, but you usually don't write them with an or-join
, you just declare 2 implementations of the rule
@val_waeselynck: so, something like this?
'[[(item-for-subitem ?item ?sub)
[?item :item/subitem ?sub]]
[(item-for-subitem ?item ?sub)
(item-for-subitem ?item ?mid)
[?mid :item/subitem ?sub]]]
That seems less clearly recursive to me for some reason, but if that’s the standard, good to knowhi all, I’m new to both Clojure and Datomic, but I’ve been hovering around both for awhile now. Downloaded Datomic Pro Starter, have the http://my.datomic.com credentials, trying to experiment with Datomic Pro using boot. For an IDE, I’m using Atom with the proto-repl plugin.
When I tried to start the repl from the build.boot file I have open, I got the following error:
No such task (dev)
boot.core/construct-tasks
core.clj
I figured I needed a deftask named dev, and sure enough, adding this to build.boot got around that error:
(deftask dev [])
I think dev
is the task proto repl expects to start your repl, but doesn't call repl directly to allow you to do things like start file watchers or compile sass
Now, to start using Datomic pro, I’ve added a dependency to my build.boot file, like so:
(set-env! :resource-paths #{"src"}
:dependencies '[[org.clojure/clojure "RELEASE"]
[framework-one "RELEASE"]
[com.datomic/datomic-pro "0.9.5385"]]
:repositories #(conj %
["my-datomic" {:url ""
:username “my-datomic-user"
:password “my-datomic-pass"}]))
Using the require statement I see in the tutorial doesn’t seem to work if I try and evaluate it in the repl:
(ns telogenix.model.schema
(:require [datomic.api :as d]))
user=> ClassNotFoundException clojure.lang.Tuple java.net.URLClassLoader.findClass (URLClassLoader.java:381)
The dependency and repository seem to be correct, because I can run the project and all dependencies seem to resolve without error.
Smells like an IDE/config issue, not Datomic specific. I’d ask boot, atom users or in an editor/ide channel. also “RELEASE” if present in that form also needs a real version number added.
@bkamphaus: I think RELEASE works without a number, no?
@nando: Could you try (require '[datomic.api :as d])
at the repl instead? Not entirely sure how the user repl behaves when subject to (ns)
You should be able to do (d/conn ...)
and all the other good parts of the datomic api. connecting is a decent test.
oh, ok, I haven’t used metaversions ever, nevermind on that.
@bkamphaus: They're, admittedly, dodgy. But a fairly good way to get going fast.
Is following the example code in the seattle subdirectory still the recommended way to get started?
Or is there something more current? I’m referring to the sample app included with the datomic download.
NP. I’ll continue to muddle through and try to get something working. I’ll start by creating a schema.edn file now that I seem to have datomic set up.