datascript

joshcho 2023-02-11T14:29:20.740689Z

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

2023-02-13T02:29:01.844559Z

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

👍 2
2023-02-13T02:30:19.260919Z

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

Niki 2023-02-13T15:21:37.351639Z

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