sea_orm/schema/
mod.rs

1use crate::DbBackend;
2
3mod builder;
4mod entity;
5#[cfg(feature = "serde_json")]
6mod json;
7mod topology;
8
9pub use builder::*;
10use topology::*;
11
12/// This is a helper struct to convert [`EntityTrait`](crate::EntityTrait)
13/// into different [`sea_query`](crate::sea_query) statements.
14#[derive(Debug)]
15pub struct Schema {
16    backend: DbBackend,
17}
18
19impl Schema {
20    /// Create a helper for a specific database backend
21    pub fn new(backend: DbBackend) -> Self {
22        Self { backend }
23    }
24
25    /// Creates a schema builder that can apply schema changes to database
26    pub fn builder(self) -> SchemaBuilder {
27        SchemaBuilder::new(self)
28    }
29}