Expand description
Database schema creation and management.
§Versioned migration system
The schema is versioned via the kg_schema_version table (single-row).
Call ensure_schema on every database open to apply any pending migrations
automatically.
| Version | Changes |
|---|---|
| 1 | Initial schema: entities, relations, vectors, hyperedges, turboquant cache |
| 2 | Add vectors_checksum column to kg_turboquant_cache |
Functions§
- create_
schema - Create the knowledge graph schema in the database.
- ensure_
schema - Ensure the database schema is up to date, running any pending migrations.
- schema_
exists - Check if the core schema tables exist (used for legacy-DB detection).
- schema_
version - Return the current schema version stored in the database.