This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-26
Channels
- # aleph (2)
- # aws-lambda (18)
- # beginners (81)
- # boot (3)
- # cider (25)
- # cljs-dev (274)
- # cljsjs (10)
- # clojars (25)
- # clojure (65)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-dev (33)
- # clojure-dusseldorf (6)
- # clojure-gamedev (3)
- # clojure-italy (17)
- # clojure-poland (3)
- # clojure-russia (7)
- # clojure-spec (48)
- # clojure-uk (45)
- # clojured (1)
- # clojurescript (26)
- # core-logic (2)
- # data-science (4)
- # datascript (6)
- # datomic (58)
- # defnpodcast (2)
- # docker (1)
- # duct (14)
- # figwheel (2)
- # fulcro (130)
- # graphql (3)
- # leiningen (1)
- # liberator (15)
- # luminus (5)
- # nrepl (1)
- # numerical-computing (1)
- # off-topic (45)
- # onyx (15)
- # re-frame (9)
- # reagent (3)
- # ring (1)
- # shadow-cljs (91)
- # spacemacs (8)
- # sql (23)
- # unrepl (38)
- # videos (2)
- # vim (12)
another question. Hopefully i’ll figure this out shortly.
(ns game.db
(:require [datascript.core :as d]))
(def schema
{
:player/name
{:db/valueType :db.type/string
:db/cardinality :db.cardinality/one}})
(def conn (d/create-conn schema))
Throws this error:
1. Caused by clojure.lang.ExceptionInfo
Bad attribute specification for #:player{:name #:db{:valueType
:db.type/string}}, expected one of #{:db.type/ref}
{:error :schema/validation,
:attribute :player/name,
:key :db/valueType,
:value :db.type/string}
which tells me the issue, i just dont get it. why does it expect valueType to have to be a ref? maybe i’m only supposed to specify refs with this setup? I would like to specify the types of everything though in the db…i’m trying to follow some combination of the datomic and datascript docs. Notable this example: https://github.com/cognitect-labs/day-of-datomic-cloud/blob/master/tutorial/hello_world.clj
possible because im not resetting the db…
https://github.com/tonsky/datascript/wiki/Tips-&-tricks yea. ok so its a bit different then datomic. Thats ok.
howdy. im a datomic/datascript newb.
Here's what I'd like to do:
- I have a collection of maps that changes over time [{:a 1 :b 2} ...]
.
- Every five minutes I go out and check if there's a new version of this collection. If there is, I would like to incrementally update my datascript store. I don't care about being able to query old versions, I just want my datascript db to be the current view of that collection.
Question:
- There are a lot of maps in this collection. For my described use case would you recommend I just swap an atom using a background thread containing something like (d/with-db (d/empty-db) (map #(assoc % :db/id (d/tempid 1)) my-coll-of-maps)
?