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.
Perfect, thanks!
Is there some way to get the schema from the database value as well, or only the connection?
In Datalevin, DB is.not a value (not an immutable DB). You can get schema from DB by calling (datalevin.db/-schema db)
Thanks. If the DB isn't a value, what's the difference between a connection and a DB?
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.
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.
https://cljdoc.org/d/datalevin/datalevin/0.9.27/api/datalevin.core#schema