Insert a model into database # Example (Postgres) ``` # use sea_orm::{error::*, tests_cfg::*, *}; # # #[smol_potat::main] # #[cfg(feature = "mock")] # pub async fn main() -> Result<(), DbErr> { # # let db = MockDatabase::new(DbBackend::Postgres) # .append_query_results([[maplit::btreemap! { # "id" => Into:: ::into(15), # }]]) # .into_connection(); # use sea_orm::{entity
(model: A)
| 413 | /// # } |
| 414 | /// ``` |
| 415 | fn insert<A>(model: A) -> Insert<A> |
| 416 | where |
| 417 | A: ActiveModelTrait<Entity = Self>, |
| 418 | { |
| 419 | Insert::one(model) |
| 420 | } |
| 421 | |
| 422 | /// Insert many models into database |
| 423 | /// |
no outgoing calls