Fork me on GitHub
#datomic
<
2016-02-19
>
casperc14:02:38

Is it possible to transact named query rules to the database, so you can avoid adding the % in your query, but still name them in your where-clause?

jgdavey15:02:28

@casperc No. All query-time stuff lives in a peer. That includes any rules you bring to the party.

casperc15:02:18

@jgdavey: Ok thanks, I just figured it would be able to fetch it like it is able to with database functions. But I guess that is a choice they made to not allow that.

chadhs17:02:18

Can you set a retention period for data with Datomic so it doesn't grow forever?

Ben Kamphaus17:02:07

@chadhs: not at present. That said, dropping history after a retention period is a feature that’s been requested several times and is under consideration.

chadhs17:02:17

Good to know thanks!

sdegutis18:02:31

Why does missing? have special syntax like [(missing? $ ?product :product/parent)]? Considering refs cannot ever have nil, why doesn't Datomic just use the syntax [?product :product/parent nil] instead?

iwankaramazow21:02:23

I have a question about generating unique id's. Let's say I have a :person-entity that needs an id I can query through :person/id. In my schema should I just enter:

{:db/id (d/squuid)
  :db/ident :person/id
  :db/valueType :db.type/uuid
  :db/cardinality :db.cardinality/one
  :db/unique :db.unique/identity
  :db.install/_attribute :db.part/db}
I am hoping whenever I transact a new Person, Datomic automatically generates that id... Does this make any sense, is there a better way of achieving this? (I'm very new to Datomic...)

jgdavey21:02:24

It looks like you’re conflating creating schema entities with domain entities.

jgdavey21:02:35

The :db/id of schema entity should be #db/id [:db.part/db]

jgdavey21:02:58

Once you have that :person/id attribute available to you, you could create a “new” person like {:db/id (d/tempid :db.part/user), :person/id (d/squuid)}

iwankaramazow21:02:36

My code works 😄

iwankaramazow21:02:36

feels like a very stupid question, now I understand the difference 😬