Skip to main content

wasm_dbms_api/dbms/
table.rs

1//! This module contains types related to database tables.
2
3mod column_def;
4mod record;
5mod schema;
6
7use serde::{Deserialize, Serialize};
8use thiserror::Error;
9
10pub use self::column_def::{
11    CandidDataTypeKind, CandidForeignKeyDef, ColumnDef, ForeignKeyDef, IndexDef, JoinColumnDef,
12};
13pub use self::record::{
14    InsertRecord, TableColumns, TableRecord, UpdateRecord, ValuesSource, flatten_table_columns,
15};
16pub use self::schema::{
17    ColumnSnapshot, CustomDataTypeSnapshot, DataTypeSnapshot, ForeignKeySnapshot, IndexSnapshot,
18    OnDeleteSnapshot, TableFingerprint, TableSchema, TableSchemaSnapshot, WireSize,
19    fingerprint_for_name,
20};
21
22/// Table related errors
23#[derive(Debug, Error, Deserialize, Serialize)]
24#[cfg_attr(feature = "candid", derive(candid::CandidType))]
25pub enum TableError {
26    #[error("Table not found")]
27    TableNotFound,
28    #[error("Schema mismatch")]
29    SchemaMismatch,
30}