This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-12
Channels
- # beginners (40)
- # boot (2)
- # cider (16)
- # clara (2)
- # cljs-experience (2)
- # clojure (100)
- # clojure-italy (11)
- # clojure-russia (2)
- # clojure-spec (9)
- # clojure-uk (34)
- # clojurescript (36)
- # community-development (3)
- # core-async (4)
- # cursive (4)
- # datascript (1)
- # datomic (20)
- # duct (10)
- # emacs (1)
- # fulcro (2)
- # off-topic (40)
- # onyx (12)
- # overtone (8)
- # portkey (6)
- # quil (1)
- # re-frame (7)
- # ring-swagger (2)
- # shadow-cljs (2)
- # spacemacs (2)
- # test200 (10)
- # tools-deps (16)
- # unrepl (1)
- # vim (24)
I apologize if this sounds noobish but I can honestly not find the answer to this. I need to have various.. "tables" in the schema, and I'm actually just wondering how to insert into a particular schema. This is the code I have right now:
(def schema
{:guild/id {:db/unique :db.unique/identity}
:channel/id {:db/unique :db.unique/identity}
:message/id {:db/unique :db.unique/identity}
:role/id {:db/unique :db.unique/identity}
:emoji/id {:db/unique :db.unique/identity}
:user/id {:db/unique :db.unique/identity}
:user {:db/type :db.type/ref}
:guild {:db/type :db.type/ref}
:channel {:db/type :db.type/ref}
})
(def conn (d/create-conn schema))
where d
is datascript.core
. Pretty much all the examples I've seen only have a single table (like that aka
ones in the readme and examples) so I'm a little stumped as to how to structure my d/transact!
function to properly insert, say, a guild
in there. I'm unfortunately looking at old code that I haven't touched in a while so I don't even remember how I got to this schema 😕