pub struct Schema {
pub name: String,
pub pk: String,
pub required_fields: HashSet<String>,
pub types: HashMap<String, Type>,
pub defaults: HashMap<String, Value>,
}Expand description
The Schema struct represents the schema of a table in the database
§Fields
name- the name of the tablepk- the name of the primary key- currently only single primary key is supported
required_fields- the names of the required fields (especially needed in write operations), it includes 2 cases:- the field is required (cannot be NULL)
- the field is pk (primary key)
types- the data types of the columns in the tabledefaults- the default values for the columns in the table
Fields§
§name: String§pk: String§required_fields: HashSet<String>§types: HashMap<String, Type>§defaults: HashMap<String, Value>Implementations§
Trait Implementations§
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more