datalevin

2026-02-26T23:02:23.031529Z

i tried reading some tutorials about datalog (linked from the datascript repo) and there's not much info about how to insert new records. is :db/id required for all new records? do i need to use decremented negative numbers when adding multiple maps in a single call?

Huahai 2026-02-27T01:33:29.223149Z

There are many ways to add new records (maybe too many ways). You don't need to use :db/id, unless you want to have related datoms that refer to each other, so you use negative numbers (or string) for temp entity ids. If your records do not refer to each other, just use map or vector.

Huahai 2026-02-27T01:36:14.556769Z

BTW, when we release 1.0. there will be a companion book, Datalevin: the Definite Guide at http://datalevin.org Web site, Stay tuned.

👍 4
👍🏼 1
2
5
2026-02-27T01:47:01.346959Z

a book sounds great

2026-02-27T01:48:05.767929Z

having a definitive source for the accepted syntax would help newcomers like me, especially when this has small divergences from datomic and datascript

Max 2026-02-27T02:07:44.493699Z

Are there any differences between datomic and datalevin wrt insertions of triples, or is it all the same?

Huahai 2026-02-27T03:13:54.351479Z

There are some slight differences. Datalevin supports large values, doesn't have a URI type, no partition, schema/data type is not mandatory, etc. Syntax wise, it's pretty much the same.