Skip to content

Maryk Memory Store

In-memory Maryk data store implementation. Fastest option for tests and local development. No persistence.

InMemoryDataStore.open(
keepAllVersions = true,
keepUpdateHistoryIndex = true,
dataModelsById = mapOf(
1u to Account,
2u to Course
)
).use { store ->
// Run operations on the store
store.execute(
Account.add(
Account(
username="test1",
password="test1234"
),
Account(
username="test2",
password="test1234"
)
)
)
}

The .use { ... } scope closes the store automatically.

  • Unit/integration tests.
  • Local development.
  • CI with deterministic behavior and zero external dependencies.
  • Data is lost on close/shutdown.
  • Not suitable as persistent production storage.
  • keepAllVersions: Keep historic values/indexes/uniques for toVersion, changes, and history queries.
  • keepUpdateHistoryIndex: Keep an engine-level update history index ordered by latest change. With this enabled, scanUpdates(order = null) uses newest-first change order by default.