Skip to main content

create_embeddings_table

Function create_embeddings_table 

Source
pub fn create_embeddings_table(model: &ModelName, dim: usize) -> String
Expand description

The per-model embedding table (§4.1, D-005), for a validated model name.

A function rather than a const because the table’s identity and its column type both depend on the model: F32_BLOB(dim) carries the declared dimension in the schema, which is what crate::vector::declared_dimension reads back so the crate never keeps a second copy of it.

Deliberately not part of the baseline migration. Which models exist is an application’s choice made over time, not a property of the schema version, and D-036 classifies these tables as disposable periphery: a migration may drop one and re-embed. IF NOT EXISTS makes registration idempotent.

No temporal columns, on purpose. Doctrine VII makes an embedding a derived artifact of a model applied to content — it has no valid time of its own, and giving it a recorded_at would put a third clock next to the two §2 permits and invite queries that mix them.