floz-orm 0.1.7

A lightweight, typesafe Rust ORM — unifying DAO and DSL from a single schema
Documentation
//! ORM type aliases — semantic DB types that map to SQL.
//!
//! These are **transparent type aliases** (zero runtime cost). Users write them
//! in struct fields; the `#[model]` proc macro reads the **token name** to
//! determine the SQL column type for DDL generation and migrations.
//!
//! | Rust type       | SQL (Postgres)       | SQL (SQLite) |
//! |-----------------|----------------------|--------------|
//! | `Varchar`       | VARCHAR(255)         | TEXT         |
//! | `Text`          | TEXT                 | TEXT         |
//! | `Timestamp`     | TIMESTAMP            | TEXT         |
//! | `TimestampTz`   | TIMESTAMPTZ          | TEXT         |
//! | `Date`          | DATE                 | TEXT         |
//! | `Decimal`       | NUMERIC              | REAL         |
//! | `Json`          | JSON                 | TEXT         |
//! | `Jsonb`         | JSONB                | TEXT         |
//! | `Bytes`         | BYTEA                | BLOB         |
//!
//! Native Rust types also work: `i32` → INT, `i64` → BIGINT, `bool` → BOOLEAN,
//! `String` → VARCHAR(255), `f32` → REAL, `f64` → DOUBLE PRECISION.

// ── String types ──

/// Maps to `VARCHAR(255)`. Override length with `#[col(max = N)]`.
pub type Varchar = String;

/// Maps to `TEXT` — unlimited length string.
pub type Text = String;

// ── Temporal types ──

/// Maps to `TIMESTAMP` (without time zone).
pub type Timestamp = chrono::NaiveDateTime;

/// Maps to `TIMESTAMPTZ` (with time zone).
pub type TimestampTz = chrono::DateTime<chrono::Utc>;

/// Maps to `DATE`.
pub type Date = chrono::NaiveDate;

// ── Numeric types ──

/// Maps to `NUMERIC`. Override precision/scale with `#[col(precision = N, scale = N)]`.
pub type Decimal = f64;

// ── Binary / JSON ──

/// Maps to `JSON`.
pub type Json = serde_json::Value;

/// Maps to `JSONB`.
pub type Jsonb = serde_json::Value;

/// Maps to `BYTEA` (Postgres) / `BLOB` (SQLite).
pub type Bytes = Vec<u8>;