drizzle-postgres 0.1.15

A type-safe SQL query builder for Rust
Documentation
use drizzle_core::SQLColumn;

use crate::values::PostgresValue;
pub trait PostgresColumn<'a>: SQLColumn<'a, PostgresValue<'a>> {
    const SERIAL: bool = false;
    const BIGSERIAL: bool = false;
    const GENERATED_IDENTITY: bool = false;
    /// `true` = GENERATED ALWAYS AS IDENTITY, `false` = GENERATED BY DEFAULT AS IDENTITY.
    /// Only meaningful when `GENERATED_IDENTITY` is `true`.
    const IDENTITY_ALWAYS: bool = true;
}

impl<'a, T> PostgresColumn<'a> for &T
where
    T: PostgresColumn<'a>,
    for<'r> &'r T: SQLColumn<'a, PostgresValue<'a>>,
{
    const SERIAL: bool = T::SERIAL;
    const BIGSERIAL: bool = T::BIGSERIAL;
    const GENERATED_IDENTITY: bool = T::GENERATED_IDENTITY;
    const IDENTITY_ALWAYS: bool = T::IDENTITY_ALWAYS;
}