Fork me on GitHub
#datascript
<
2023-02-11
>
joshcho14:02:20

I have noticed :db/id is negative. Is it standard practice to keep all id's negative?

hiredman02:02:01

I believe they are required to be positive, negative IDs are used temporarily in transactions until they are resolved to real ids

👍 3
hiredman02:02:19

https://github.com/tonsky/datascript/blob/master/src/datascript/db.cljc#L1126 defines tempid? which is true for negative numbers or strings

Niki15:02:37

Yes, negative ids are just placeholders that will be replaced with real ones. Same negative ids will have same real id after tx