deuterium 0.3.1

Deuterium is a fancy SQL builder for Rust. It's designed to provide a DSL to easily build SQL queries in safe and *typed* way.
use super::super::from::{self, Table};

pub trait FromToSql {
    fn to_from_sql(&self, ctx: &mut super::SqlContext) -> String;
}

impl FromToSql for from::TableDef {
    fn to_from_sql(&self, _ctx: &mut super::SqlContext) -> String {
        let name = self.get_table_name();
        match self.get_table_alias() {
            &Some(ref alias) => format!("{} AS {}", name, alias),
            &None => format!("{}", name),
        }
    }
}

impl FromToSql for from::SharedTable {
    fn to_from_sql(&self, _ctx: &mut super::SqlContext) -> String {
        let name = self.get_table_name();
        match self.get_table_alias() {
            &Some(ref alias) => format!("{} AS {}", name, alias),
            &None => format!("{}", name),
        }
    }
}