uqa-storage-sqlite 0.3.8

SQLite catalog, indexes, compressed storage, graph and key/value providers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//
// Unified Query Algebra
//
// Copyright (c) 2023-2026 Cognica, Inc.
//

//! Persisted table-constraint metadata.

use super::super::super::{Catalog, Result};

pub(super) fn migrate(tx: &rusqlite::Connection) -> Result<()> {
    let constraints_already_present = Catalog::table_columns(tx, "_tables")?
        .is_some_and(|columns| columns.contains_key("constraints"));
    if !constraints_already_present {
        tx.execute_batch("ALTER TABLE _tables ADD COLUMN constraints TEXT NOT NULL DEFAULT '';")?;
    }
    Ok(())
}