Skip to main content

ensure_vec_schema

Function ensure_vec_schema 

Source
pub async fn ensure_vec_schema(
    conn: &Connection,
    dims: usize,
    vec_conn: Option<&VecConnection>,
) -> bool
Expand description

Ensure the vec_embeddings ANN virtual table exists.

When a VecConnection is provided, the DDL is executed on it (where sqlite-vec is registered). Otherwise falls back to the main libsql connection (which may not have vec, in which case the CREATE silently fails). Returns true if the table is available after this call.