pub struct SchemaSet { /* private fields */ }Expand description
A collection of model schemas exported as one SQL schema.
Implementations§
Source§impl SchemaSet
impl SchemaSet
Sourcepub fn validate(&self) -> Result<(), SchemaError>
pub fn validate(&self) -> Result<(), SchemaError>
Validates every registered table and rejects duplicate table names.
Sourcepub fn try_to_sql<D: SqlDialect>(&self) -> Result<String, SchemaError>
pub fn try_to_sql<D: SqlDialect>(&self) -> Result<String, SchemaError>
Exports SQL and returns schema validation errors instead of panicking.
Source§impl SchemaSet
impl SchemaSet
Sourcepub fn tables(&self) -> &[TableSchema]
pub fn tables(&self) -> &[TableSchema]
Returns registered tables in schema order.
Sourcepub fn model_names(&self) -> &[&'static str]
pub fn model_names(&self) -> &[&'static str]
Returns model names parallel to SchemaSet::tables.
Sourcepub fn client_model<M: SyncModel>(self) -> Self
pub fn client_model<M: SyncModel>(self) -> Self
Register the local editable projection and its confirmed server shadow.
Sourcepub fn server_model<M: SyncModel>(self) -> Self
pub fn server_model<M: SyncModel>(self) -> Self
Register authoritative server data, without a shadow table.
pub fn sync_models(&self) -> &[SyncRegistration]
Sourcepub fn merge(self, other: Self) -> Self
pub fn merge(self, other: Self) -> Self
Merges another application schema after the current tables.
Sourcepub fn to_sql<D: SqlDialect>(&self) -> String
pub fn to_sql<D: SqlDialect>(&self) -> String
Exports the desired schema as semicolon-delimited SQL.
Trait Implementations§
impl Eq for SchemaSet
Source§impl From<&SchemaSet> for ProjectState
impl From<&SchemaSet> for ProjectState
impl StructuralPartialEq for SchemaSet
Auto Trait Implementations§
impl Forget for SchemaSet
impl Freeze for SchemaSet
impl Move for SchemaSet
impl RefUnwindSafe for SchemaSet
impl Send for SchemaSet
impl Sync for SchemaSet
impl Unpin for SchemaSet
impl UnsafeUnpin for SchemaSet
impl UnwindSafe for SchemaSet
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