derive-sql 0.13.0

Structure the interaction with SQL databases - currently SQLite and MySQL via trait and a procedural macro
Documentation
use super::*;

/// Trait to be implemented for filtering. Returns the contents of a `WHERE` clause.
pub trait FlavoredFilter {
  fn filter<C, R>(&self, conn: &C) -> Result<String>
  where C: Connection<R>,
        R: Row;
}

/// Trait to be implemented for filtering. Returns the contents of a `WHERE` clause.
pub trait Filter {
  fn filter(&self) -> String;
}

impl<F> FlavoredFilter for F
where F: Filter
{
  fn filter<C, R>(&self, _conn: &C) -> Result<String>
  where C: Connection<R>,
        R: Row,
  {
    Ok(Filter::filter(self))
  }
}