pub struct Schema {
pub tables: HashMap<String, Table>,
pub indexes: Vec<Index>,
pub migrations: Vec<MigrationHint>,
pub extensions: Vec<Extension>,
pub comments: Vec<Comment>,
pub sequences: Vec<Sequence>,
pub enums: Vec<EnumType>,
pub views: Vec<ViewDef>,
pub functions: Vec<SchemaFunctionDef>,
pub triggers: Vec<SchemaTriggerDef>,
pub grants: Vec<Grant>,
pub policies: Vec<RlsPolicy>,
}Expand description
A complete database schema.
Fields§
§tables: HashMap<String, Table>§indexes: Vec<Index>§migrations: Vec<MigrationHint>§extensions: Vec<Extension>PostgreSQL extensions (e.g. uuid-ossp, pgcrypto, PostGIS)
comments: Vec<Comment>Schema-level comments on tables/columns
sequences: Vec<Sequence>Standalone sequences
enums: Vec<EnumType>Standalone ENUM types
views: Vec<ViewDef>Views
functions: Vec<SchemaFunctionDef>PL/pgSQL functions
triggers: Vec<SchemaTriggerDef>Triggers
grants: Vec<Grant>GRANT/REVOKE permissions
policies: Vec<RlsPolicy>RLS policies
Implementations§
Source§impl Schema
impl Schema
pub fn new() -> Self
pub fn add_table(&mut self, table: Table)
pub fn add_index(&mut self, index: Index)
pub fn add_hint(&mut self, hint: MigrationHint)
pub fn add_extension(&mut self, ext: Extension)
pub fn add_comment(&mut self, comment: Comment)
pub fn add_sequence(&mut self, seq: Sequence)
pub fn add_enum(&mut self, enum_type: EnumType)
pub fn add_view(&mut self, view: ViewDef)
pub fn add_function(&mut self, func: SchemaFunctionDef)
pub fn add_trigger(&mut self, trigger: SchemaTriggerDef)
pub fn add_grant(&mut self, grant: Grant)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin 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