datalevin

cjohansen 2026-01-17T21:05:15.270039Z

How can I access the datalevin schema? In Datomic, the schema is queryable, and in Datascript it's directly accessible from the connection (and from entities). Does Datalevin have something similar? I want to dynamically find unique attributes etc.

cjohansen 2026-01-18T08:59:02.063269Z

Perfect, thanks!

cjohansen 2026-01-18T09:05:46.437309Z

Is there some way to get the schema from the database value as well, or only the connection?

Huahai 2026-01-18T17:00:32.127389Z

In Datalevin, DB is.not a value (not an immutable DB). You can get schema from DB by calling (datalevin.db/-schema db)

cjohansen 2026-01-18T18:09:38.514049Z

Thanks. If the DB isn't a value, what's the difference between a connection and a DB?

Huahai 2026-01-18T19:10:54.788219Z

connection is just an atom holding the DB. connection is the level we do with-transaction , where callback listeners are registered, and where asynchronous transaction is done. Basically, it provides a level of indirection for us to do extra things.

Huahai 2026-01-18T19:17:43.600569Z

When I say DB is not a value, it doesn't mean we have only one DB instance that we bash upon, we do change DB instances when you transact, however, you should not expect a same DB instance gives you the same data.