Skip to main content

DrizzlePostgresColumn

Trait DrizzlePostgresColumn 

Source
pub trait DrizzlePostgresColumn: Sized {
    const SQL_TYPE: &'static str;
    const NEEDS_CREATE_TYPE: bool = false;

    // Required method
    fn to_postgres_value(&self) -> PostgresValue<'static>;
}
Expand description

Stub trait when no postgres driver is enabled — allows enum derives to compile without a driver feature, but the table macro’s TryFrom impls won’t be generated.

Required Associated Constants§

Source

const SQL_TYPE: &'static str

PostgreSQL column type: "text", "integer", or native enum type name

Provided Associated Constants§

Source

const NEEDS_CREATE_TYPE: bool = false

Whether this requires a CREATE TYPE (native PG enum).

Required Methods§

Source

fn to_postgres_value(&self) -> PostgresValue<'static>

Convert self to a PostgresValue for insertion/updates.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§