pub struct Schema {
pub tables: OrderedMap<Table>,
pub relationships: OrderedMap<OrderedMap<Relationship>>,
}Expand description
The tables of a schema and their relationships, in declaration order.
Fields§
§tables: OrderedMap<Table>§relationships: OrderedMap<OrderedMap<Relationship>>By table, then by name.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn from_json(v: &Value) -> Result<Schema>
pub fn from_json(v: &Value) -> Result<Schema>
A schema in the JSON form JS’s schema object has (tables, each with
name, serverName, columns, and primaryKey, and optionally
relationships).
Sourcepub fn client_schema(&self) -> ClientSchema
pub fn client_schema(&self) -> ClientSchema
The schema zero-cache checks the client’s against, with server names
(clientSchemaFrom in packages/zero-schema/src/builder/schema-builder.ts).
Sourcepub fn relationship(&self, table: &str, name: &str) -> Option<&Relationship>
pub fn relationship(&self, table: &str, name: &str) -> Option<&Relationship>
The relationship name of table.
Trait Implementations§
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Forget for Schema
impl Freeze for Schema
impl Move for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin 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