Efficiently ensure that an open store's schema is a superset of a provided schema #74

Open
opened 2020-08-06 16:54:29 +00:00 by gburd · 0 comments
gburd commented 2020-08-06 16:54:29 +00:00 (Migrated from github.com)

A typical Datomish session looks like this:

  • Open the store.
  • Transact the entire schema.
  • Do some work.

Transacting the entire schema through the generic transact layer is expensive: it's an exclusive write transaction, and it does a bunch of database-level work that's redundant, because everything about the schema in the DB was just loaded into memory during opening!

Instead of <transact!, then, we'd like something more like <ensure-schema!, which will immediately return if the provided schema form is already present in the known schema, and otherwise will transact as usual.

A typical Datomish session looks like this: - Open the store. - Transact the entire schema. - Do some work. Transacting the entire schema through the generic transact layer is expensive: it's an exclusive write transaction, and it does a bunch of database-level work that's redundant, because everything about the schema in the DB was just loaded into memory during opening! Instead of `<transact!`, then, we'd like something more like `<ensure-schema!`, which will immediately return if the provided schema form is already present in the known schema, and otherwise will transact as usual.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: greg/mentat#74
No description provided.