Fork me on GitHub
#datomic
<
2017-02-01
>
dominicm16:02:03

Reading the docs on keywords, it's mentioned that they are "interned" — does this make them closer in efficiency to a number rather than a string?

pesterhazy16:02:40

I think it refers to the fact that

(identical? (clojure.lang.Keyword/intern "a") (clojure.lang.Keyword/intern "a"))

dominicm17:02:55

Ah, I wasn't familiar with that terminology. So I guess the efficiency is more like a number than a string, neat

wei19:02:15

what’s a good way to store a value that only has one instance in the entire db? e.g. configuration or global values

wei19:02:32

or another example, a running list of the last five created entities

favila19:02:33

@wel Special "TOC" entity with an ident, put the changing things on attributes.

wei19:02:38

not sure what a TOC entity means, can you link to any info?

favila19:02:33

@wei "TOC"= table of contents

favila19:02:30

@wei example {:db/ident : :database-owner "..."}

favila19:02:58

Your "last five created entities" example is just a query, no?

favila19:02:37

In any case, we often have some entities which describe something about the database itself or reference other entities which are special in some way. A way to deal with this is to have a single well-known named entity in the db (named with an ident), and on it are attributes+values which assert those special things.

favila19:02:06

Datomic itself uses this technique for the :db.part/db partition (entity 0), where all the schema is held

wei20:02:27

i see, so : is a global entity

favila20:02:01

@wei Yes, but it's better to have the ident remain unchanging than to move the ident to a different entity

eoliphant22:02:51

Hi, i’m having a weird issue with the console. All my data are still in the db, I can run queries from both my app with an embedded peer and the query page just fine

eoliphant22:02:35

however, the ‘schema’ area doens’t show my attribute defs, and when I go to the indexes tab, and try to run say an :avet query, the attribute dripdown doesn’t list the ones I’ve added to my schema, even though again, I can run queries that use them just fine