Skip to main content

default_spec

Function default_spec 

Source
pub fn default_spec() -> IndexSpec
Expand description

The ONE canonical default IndexSpec for TopoDB’s built-in write shapes, shared by every front end (topodb-mcp when --spec is omitted; topodb-cli when it creates a brand-new db file). Declares equality on (Entity, name) and text on (Memory, content), using the shared ENTITY_LABEL/ENTITY_NAME_PROP/MEMORY_LABEL/MEMORY_CONTENT_PROP constants.

Single-sourcing this is load-bearing: because a CLI-created db and an MCP-created db are opened with a byte-identical persisted index_spec, either front end can later serve a db the other created via open_stored without triggering an FTS reindex or mis-declaring the equality index — and both find (equality on Entity/name) and search (text on Memory/content) work out of the box on a fresh db regardless of which tool wrote it.