pub struct SchemaDiscovery {
pub query: SchemaQueryBuilder,
pub executor: Executor,
pub schema: SeaRc<dyn Iden>,
}
Available on crate features
postgres
and discovery
only.Fieldsยง
ยงquery: SchemaQueryBuilder
ยงexecutor: Executor
ยงschema: SeaRc<dyn Iden>
Implementationsยง
Sourceยงimpl SchemaDiscovery
impl SchemaDiscovery
pub fn new<E>(executor: E, schema: &str) -> Selfwhere
E: IntoExecutor,
pub async fn discover(&self) -> Result<Schema, SqlxError>
pub async fn discover_tables(&self) -> Result<Vec<TableInfo>, SqlxError>
pub async fn discover_table( &self, info: TableInfo, enums: &HashMap<String, Vec<String>>, ) -> Result<TableDef, SqlxError>
pub async fn discover_columns( &self, schema: SeaRc<dyn Iden>, table: SeaRc<dyn Iden>, enums: &HashMap<String, Vec<String>>, ) -> Result<Vec<ColumnInfo>, SqlxError>
pub async fn discover_constraints( &self, schema: SeaRc<dyn Iden>, table: SeaRc<dyn Iden>, ) -> Result<Vec<Constraint>, SqlxError>
pub async fn discover_unique_indexes( &self, schema: SeaRc<dyn Iden>, table: SeaRc<dyn Iden>, ) -> Result<Vec<Unique>, SqlxError>
pub async fn discover_enums(&self) -> Result<Vec<EnumDef>, SqlxError>
Auto Trait Implementationsยง
impl Freeze for SchemaDiscovery
impl !RefUnwindSafe for SchemaDiscovery
impl !Send for SchemaDiscovery
impl !Sync for SchemaDiscovery
impl Unpin for SchemaDiscovery
impl !UnwindSafe for SchemaDiscovery
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