pub fn insert<T,D>(&self, t: &T) -> Result<D, DbError>
        where T: IsTable + IsDao, D: IsDao
    {
        let table = T::table_name();
        let dao = t.to_dao();
        let mut q = Insert::into(&table);
        for c in &table.columns {
            q.column(&c.column);
        }
        q.return_all();
        for c in &table.columns {
            let value:Option<&Value> = dao.get(&c.column);
            match value {
                Some(value) => {
                    q.value(value);
                }
                None => (),
            }
        }
        q.insert(self.db)
    }
/// insert a record into the database
insert a record into the database
insert a record into the database
pub fn insert<T,D>(&self, t: &T) -> Result<D, DbError>
        where T: IsTable + IsDao, D: IsDao
    {
        let table = T::table_name();
        let dao = t.to_dao();
        let mut q = Insert::into(&table);
        for c in &table.columns {
            q.column(&c.column);
        }
        q.return_all();
        for c in &table.columns {
            let value:Option<&Value> = dao.get(&c.column);
            match value {
                Some(value) => {
                    q.value(value);
                }
                None => (),
            }
        }
        q.insert(self.db)
    }
pub fn insert < T , D > ( & self , t : & T ) -> Result < D , DbError > where T : IsTable + IsDao , D : IsDao { let table = T :: table_name ( ) ; let dao = t . to_dao ( ) ; let mut q = Insert :: into ( & table ) ; for c in & table . columns { q . column ( & c . column ) ; } q . return_all ( ) ; for c in & table . columns { let value : Option < & Value > = dao . get ( & c . column ) ; match value { Some ( value ) => { q . value ( value ) ; } None => ( ) , } } q . insert ( self . db ) }
insert a record into the database
insert a record into the database
&self
t
&T
&self
t
&T