Skip to main content

PostgresItemDdl

Trait PostgresItemDdl 

Source
pub trait PostgresItemDdl {
    const SNAPSHOT_COLUMNS: &'static [ColumnDef] = _;
    const SNAPSHOT_PRIMARY_KEY: Option<PrimaryKeyDef> = None;
    const SNAPSHOT_UNIQUE_CONSTRAINTS: &'static [UniqueConstraintDef] = _;
    const SNAPSHOT_INDEX: Option<IndexDef> = None;
    const ENUM_SCHEMA: &'static str = "public";
}
Expand description

Const DDL metadata channel from #[Postgres*] schema items to the PostgresSchema derive’s runtime to_snapshot().

Every PostgreSQL schema-item macro (table, index, enum, view, policy) implements this trait; the defaults mean “no metadata of that kind”. The schema derive reads these consts so the runtime snapshot carries the same fidelity as the compile-time DDL consts (identity sequence options, index method/where/concurrently, NULLS NOT DISTINCT, enum schemas, one composite PrimaryKey entity per table) without re-deriving any of it.

Provided Associated Constants§

Source

const SNAPSHOT_COLUMNS: &'static [ColumnDef] = _

Column definitions in declaration order (tables only).

Source

const SNAPSHOT_PRIMARY_KEY: Option<PrimaryKeyDef> = None

The table’s single (possibly composite) primary-key entity.

Source

const SNAPSHOT_UNIQUE_CONSTRAINTS: &'static [UniqueConstraintDef] = _

Unique constraints (column-level and table-level) in declaration order.

Source

const SNAPSHOT_INDEX: Option<IndexDef> = None

The index definition (index items only).

Source

const ENUM_SCHEMA: &'static str = "public"

Schema the enum type is created in (enum items only).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§