gorm 0.1.4

An orm that is simple to use and prevents all mistakes at compile time
Documentation
use deadpool_postgres::tokio_postgres::Row;

use crate::{error::*, sql::FieldsConsListItem, util::TypedConsListNil};

/// A type that can be parsed from an sql query result.
pub trait FromQueryResult: Sized {
    type Fields: FieldsConsListItem;

    fn from_row(row: Row) -> Result<Self>;
}

/// An empty query result.
pub struct EmptyQueryResult;
impl FromQueryResult for EmptyQueryResult {
    type Fields = TypedConsListNil;

    fn from_row(_row: Row) -> Result<Self> {
        Ok(Self)
    }
}