pub struct Schema {Show 13 fields
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>,
pub resources: Vec<ResourceDef>,
}Expand description
A complete database schema.
Fields§
§tables: HashMap<String, Table>Declared tables.
indexes: Vec<Index>Declared indexes.
migrations: Vec<MigrationHint>Migration hints (renames, transforms, drops).
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>SQL views (CREATE VIEW / CREATE MATERIALIZED VIEW).
functions: Vec<SchemaFunctionDef>PL/pgSQL functions
triggers: Vec<SchemaTriggerDef>Database triggers (CREATE TRIGGER).
grants: Vec<Grant>GRANT/REVOKE permissions
policies: Vec<RlsPolicy>RLS policies
resources: Vec<ResourceDef>Infrastructure resources (buckets, queues, topics)
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn add_hint(&mut self, hint: MigrationHint)
pub fn add_hint(&mut self, hint: MigrationHint)
Add a migration hint.
Sourcepub fn add_extension(&mut self, ext: Extension)
pub fn add_extension(&mut self, ext: Extension)
Add a PostgreSQL extension.
Sourcepub fn add_comment(&mut self, comment: Comment)
pub fn add_comment(&mut self, comment: Comment)
Add a schema comment.
Sourcepub fn add_sequence(&mut self, seq: Sequence)
pub fn add_sequence(&mut self, seq: Sequence)
Add a standalone sequence.
Sourcepub fn add_function(&mut self, func: SchemaFunctionDef)
pub fn add_function(&mut self, func: SchemaFunctionDef)
Add a function definition.
Sourcepub fn add_trigger(&mut self, trigger: SchemaTriggerDef)
pub fn add_trigger(&mut self, trigger: SchemaTriggerDef)
Add a trigger definition.
Sourcepub fn add_resource(&mut self, resource: ResourceDef)
pub fn add_resource(&mut self, resource: ResourceDef)
Add an infrastructure resource declaration.
Sourcepub fn add_policy(&mut self, policy: RlsPolicy)
pub fn add_policy(&mut self, policy: RlsPolicy)
Add an RLS policy definition.
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 UnsafeUnpin 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