Fork me on GitHub
#datascript
<
2018-05-12
>
eslachance16:05:23

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 😕