Skip to main content

ic_dbms_api/dbms/
table.rs

1//! This module contains types related to database tables.
2
3mod column_def;
4mod record;
5mod schema;
6
7use candid::CandidType;
8use serde::{Deserialize, Serialize};
9use thiserror::Error;
10
11pub use self::column_def::{CandidColumnDef, CandidForeignKeyDef, ColumnDef, ForeignKeyDef};
12pub use self::record::{
13    InsertRecord, TableColumns, TableRecord, UpdateRecord, ValuesSource, flatten_table_columns,
14};
15pub use self::schema::{TableFingerprint, TableSchema};
16
17/// Table related errors
18#[derive(Debug, Error, CandidType, Deserialize, Serialize)]
19pub enum TableError {
20    #[error("Table not found")]
21    TableNotFound,
22    #[error("Schema mismatch")]
23    SchemaMismatch,
24}