Expand description
Attribute markers for PostgresTable derive macro.
These const markers are used within #[column(...)] and #[PostgresTable(...)]
attributes. Import them from the prelude to get IDE hover documentation.
§Example
ⓘ
#[PostgresTable(NAME = "users")]
struct User {
#[column(PRIMARY, SERIAL)]
id: i32,
#[column(UNIQUE)]
email: String,
metadata: String,
}Structs§
- Column
Marker - Marker struct for column constraint attributes.
- Name
Marker - Marker struct for the NAME attribute.
- Table
Marker - Marker struct for table-level attributes.
- Type
Marker - Marker struct for column type attributes.
- View
Marker - Marker struct for view attributes.
Constants§
- BIGINT
- Specifies a BIGINT column type (64-bit).
- BIGSERIAL
- Creates a BIGSERIAL column (auto-incrementing 64-bit integer).
- BIT
- Specifies a BIT column type.
- BIT_
VARYING - Alias for VARBIT.
- BOOL
- Alias for BOOLEAN.
- BOOLEAN
- Specifies a BOOLEAN column type.
- BOX
- Specifies a BOX column type.
- BYTEA
- Specifies a BYTEA column type (binary data).
- CASCADE
- CASCADE action: Propagate the delete/update to referencing rows.
- CHAR
- Specifies a CHAR column type.
- CHARACTER
- Alias for CHAR.
- CHARACTER_
VARYING - Alias for VARCHAR.
- CHECK
- Adds a CHECK constraint to this column.
- CIDR
- Specifies a CIDR column type.
- CIRCLE
- Specifies a CIRCLE column type.
- DATE
- Specifies a DATE column type.
- DECIMAL
- Alias for NUMERIC.
- DEFAULT
- Specifies a fixed default value for new rows.
- DEFAULT_
FN - Specifies a function to generate default values at runtime.
- DEFINITION
- Specifies a view definition SQL string or expression.
- DOUBLE
- Alias for DOUBLE PRECISION.
- DOUBLE_
PRECISION - Specifies a DOUBLE PRECISION column type (64-bit float).
- ENUM
- Marks this column as storing an enum type.
- EXISTING
- Marks the view as existing (skip creation).
- FLOAT4
- Alias for REAL.
- FLOAT8
- Alias for DOUBLE PRECISION.
- GENERATED
- Marks a column as a GENERATED AS (expression) column.
- IDENTITY
- Creates a GENERATED IDENTITY column with configurable mode.
- INET
- Specifies an INET column type.
- INHERITS
- Specifies inheritance from a parent table.
- INT
- Alias for INTEGER.
- INT2
- Alias for SMALLINT.
- INT4
- Alias for INTEGER.
- INT8
- Alias for BIGINT.
- INTEGER
- Specifies an INTEGER column type (32-bit).
- INTERVAL
- Specifies an INTERVAL column type.
- JSON
- Enables JSON serialization with JSON type storage.
- JSONB
- Enables JSON serialization with JSONB storage.
- LINE
- Specifies a LINE column type.
- LSEG
- Specifies a LSEG column type.
- MACADDR
- Specifies a MACADDR column type.
- MACADD
R8 - Specifies a MACADDR8 column type.
- MATERIALIZED
- Marks the view as materialized.
- NAME
- Specifies a custom name in the database.
- NO_
ACTION - NO ACTION action: Similar to RESTRICT (default behavior).
- NUMERIC
- Specifies a NUMERIC column type (arbitrary precision).
- ON_
DELETE - Specifies the ON DELETE action for foreign key references.
- ON_
UPDATE - Specifies the ON UPDATE action for foreign key references.
- PATH
- Specifies a PATH column type.
- POINT
- Specifies a POINT column type.
- POLYGON
- Specifies a POLYGON column type.
- PRIMARY
- Marks this column as the PRIMARY KEY.
- PRIMARY_
KEY - Alias for
PRIMARY. - REAL
- Specifies a REAL column type (32-bit float).
- REFERENCES
- Establishes a foreign key reference to another table’s column.
- RESTRICT
- RESTRICT action: Prevent delete/update if referenced.
- SCHEMA
- Specifies a view schema name.
- SERIAL
- Creates a SERIAL column (auto-incrementing 32-bit integer).
- SET_
DEFAULT - SET DEFAULT action: Set referencing columns to their default values.
- SET_
NULL - SET NULL action: Set referencing columns to NULL.
- SMALLINT
- Specifies a SMALLINT column type (16-bit).
- SMALLSERIAL
- Creates a SMALLSERIAL column (auto-incrementing 16-bit integer).
- TABLESPACE
- Specifies a tablespace for the table.
- TEMPORARY
- Creates a TEMPORARY table.
- TEXT
- Specifies a TEXT column type.
- TIME
- Specifies a TIME column type (without timezone).
- TIMESTAMP
- Specifies a TIMESTAMP column type (without timezone).
- TIMESTAMPTZ
- Specifies a TIMESTAMPTZ column type (with timezone).
- TIMESTAMP_
WITHOUT_ TIME_ ZONE - Alias for TIMESTAMP.
- TIMESTAMP_
WITH_ TIME_ ZONE - Alias for TIMESTAMPTZ.
- TIMETZ
- Specifies a TIMETZ column type (with timezone).
- TIME_
WITHOUT_ TIME_ ZONE - Alias for TIME.
- TIME_
WITH_ TIME_ ZONE - Alias for TIMETZ.
- UNIQUE
- Adds a UNIQUE constraint to this column.
- UNLOGGED
- Creates an UNLOGGED table.
- USING
- Specifies a USING clause for materialized views.
- UUID
- Specifies a UUID column type.
- VARBIT
- Specifies a VARBIT column type.
- VARCHAR
- Specifies a VARCHAR column type.
- WITH
- Sets WITH options for a view definition.
- WITH_
NO_ DATA - Create a materialized view WITH NO DATA.
- WITH_
OPTIONS - Alias for
WITH.
Type Aliases§
- Referential
Action - Type alias for referential action markers (uses ColumnMarker for macro compatibility).