Skip to main content

Module persistence

Module persistence 

Source
Expand description

Persistence backends for declared-plugin records.

M9 stores declarations in a DeclaredPluginStore in memory, but the user-visible promise of apoc.custom-style uni.plugin.declareFunction is that declarations survive restart.

Proposal §9.7 anchors the persistence schema in a Cypher-visible system label _DeclaredPlugin. That label requires write-enabled uni_plugin::traits::procedure::ProcedureHost execution, which does not exist yet (the host’s execute_inner_query is read-only and does not bind parameters). Rather than block M9 on that infrastructure, this module ships a Persistence trait with two concrete implementations:

  • NullPersistence — drops declarations on the floor; used in tests that exercise only the in-memory store.
  • JsonFilePersistence — round-trips the DeclaredPlugin serde shape through a JSON sidecar file under the instance’s data directory.

The schema matches proposal §9.7 field-for-field, so the eventual cutover to _DeclaredPlugin (when write-enabled host execution lands) is a drop-in impl Persistence for SystemLabelPersistence.

Structs§

JsonFilePersistence
On-disk JSON-sidecar persistence.
NullPersistence
In-memory persistence that drops every record on the floor.

Enums§

PersistenceError
Errors raised by Persistence backends.

Traits§

Persistence
A persistence backend for declared-plugin records.