pub struct PortableSchema {
pub dialect: String,
pub tables: BTreeMap<String, PortableTable>,
}Expand description
Dialect-agnostic snapshot of a full database schema, suitable for serialization and for driving synthetic data generation without depending on the DDL parser internals.
Fields§
§dialect: StringThe dialect the source DDL was parsed with (e.g. "mysql").
tables: BTreeMap<String, PortableTable>Tables keyed by name for lookup; use each table’s own Vec fields
when order matters (declaration order is not implied by map order).
Implementations§
Source§impl PortableSchema
impl PortableSchema
Sourcepub fn from_runtime(schema: &Schema, dialect: SqlDialect) -> Self
pub fn from_runtime(schema: &Schema, dialect: SqlDialect) -> Self
Build a portable snapshot from a parsed runtime Schema.
Trait Implementations§
Source§impl Clone for PortableSchema
impl Clone for PortableSchema
Source§fn clone(&self) -> PortableSchema
fn clone(&self) -> PortableSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PortableSchema
impl Debug for PortableSchema
Source§impl<'de> Deserialize<'de> for PortableSchema
impl<'de> Deserialize<'de> for PortableSchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PortableSchema
Source§impl JsonSchema for PortableSchema
impl JsonSchema for PortableSchema
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for PortableSchema
impl PartialEq for PortableSchema
Source§impl Serialize for PortableSchema
impl Serialize for PortableSchema
impl StructuralPartialEq for PortableSchema
Auto Trait Implementations§
impl Freeze for PortableSchema
impl RefUnwindSafe for PortableSchema
impl Send for PortableSchema
impl Sync for PortableSchema
impl Unpin for PortableSchema
impl UnsafeUnpin for PortableSchema
impl UnwindSafe for PortableSchema
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more