datascript

2024-05-03T12:38:10.256479Z

is there a test or example anywhere for querying across a few databases? the high-level docs suggest that this is possible, but I can't find any pointer to how it works. I have a context where there's a shared "core" of data plus many smaller slices of data that are a lot easier to work with if they're each their own little world. I'd love to be able to say in O(1) time "merge this specific database with the core database, and now query them together". the lifecycle of the specific databases is hard to follow, so I'd be glad to make them GC-able. otherwise the main DB is likely to accumulate them forever and become a memory problem in a long session.

2024-05-03T13:19:10.332449Z

in practice the databases are immutable values and the specific data is much smaller than the shared core, so it's acceptable to do (-> shared-core-conn d/db (d/db-with specific-data) d/conn-from-db) I guess. but that does freeze the upstream data, which isn't ideal. it's immutable but it's a local subset of the full world, expanding over time as more information is pulled from the server, so it would be slick if the two were merged dynamically at query time.

2024-05-03T14:48:46.725199Z

ah, cool! I think that will work fairly well. I'll have to play around with it more.

👌 1