Backend Plugins¶
Backend plugins must return an object implementing
codira.contracts.IndexBackend.
The smallest working example lives at
examples/plugins/codira_demo_backend.
Backends are different from analyzers:
- exactly one backend is active for one repository instance
- the backend is selected by name through
CODIRA_INDEX_BACKEND - analyzers can be many; backends are singular
Register a backend:
[project.entry-points."codira.backends"]
demo = "codira_demo_backend:build_backend"
Select it:
export CODIRA_INDEX_BACKEND=demo-backend
codira index
Rules:
- backend names must be unique across built-ins and external plugins
- duplicate names are rejected deterministically
- unsupported backend names fail fast before indexing or query work
- backend plugins must not perform language parsing
Pragmatic recommendation:
- start by wrapping or adapting existing storage behavior
- only then introduce a fully independent persistence implementation