ignis-db 0.2.0

A comprehensive PostgreSQL ORM with macro-driven schema management
Documentation
//! Join system for building type-safe database queries

use crate::dsl::Column;

/// Join condition between two tables
#[derive(Debug, Clone)]
pub struct On<L, R> {
    pub left: Column<L>,
    pub right: Column<R>,
}

/// Extension trait for columns to create join conditions
pub trait ColumnExt<T> {
    fn eq_column<U>(self, other: Column<U>) -> On<T, U>;
}

impl<T> ColumnExt<T> for Column<T> {
    fn eq_column<U>(self, other: Column<U>) -> On<T, U> {
        On {
            left: self,
            right: other,
        }
    }
}