InsertMany function for create trait.

Changed path to DateTimeInterval.

Changed lifetimes on derives with async_trait
This commit is contained in:
Martin Berg Alstad
2024-08-25 17:56:56 +02:00
parent 762330189d
commit eeab1257e3
11 changed files with 80 additions and 56 deletions

View File

@ -34,7 +34,11 @@ where
Self: Sized,
{
type Insert: Insertable<Table>;
async fn create(insert: Self::Insert, conn: &mut AsyncPgConnection) -> Result<Self, CrudError>;
async fn insert(insert: Self::Insert, conn: &mut AsyncPgConnection) -> Result<Self, CrudError>;
async fn insert_many(
insert: &[Self::Insert],
conn: &mut AsyncPgConnection,
) -> Result<Vec<Self>, CrudError>;
}
/// Gets an entity from the database