derive_sql/traits/
insert.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use super::*;

pub trait InsertStatement {
  fn insert_stmt(&self) -> Result<String>;
}

pub trait Insert<C, R, T> 
where C: Connection<R>,
      R: Row,
{
  fn insert(&self, conn: &mut C, object: &T) -> Result<()>;
}

pub trait InsertMultiple<'a, C, R, T: 'a>
where C: Connection<R>,
      R: Row,
{
  fn insert_multiple<I>(&self, conn: &mut C, objects: I) -> Result<()>
  where I: core::iter::IntoIterator<Item = &'a T>;
}