Will fail, as expected
This commit is contained in:
parent
d5de8b1c48
commit
9655805316
@ -275,8 +275,11 @@ pub trait EntityTrait: EntityName {
|
|||||||
/// # Example (Postgres)
|
/// # Example (Postgres)
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
/// # use sea_orm::{error::*, tests_cfg::*, *};
|
||||||
|
/// #
|
||||||
|
/// # #[smol_potat::main]
|
||||||
/// # #[cfg(feature = "mock")]
|
/// # #[cfg(feature = "mock")]
|
||||||
/// # use sea_orm::{error::*, tests_cfg::*, MockDatabase, MockExecResult, Transaction, DbBackend};
|
/// # pub async fn main() -> Result<(), DbErr> {
|
||||||
/// #
|
/// #
|
||||||
/// # let db = MockDatabase::new(DbBackend::Postgres)
|
/// # let db = MockDatabase::new(DbBackend::Postgres)
|
||||||
/// # .append_exec_results(vec![
|
/// # .append_exec_results(vec![
|
||||||
@ -294,15 +297,10 @@ pub trait EntityTrait: EntityName {
|
|||||||
/// ..Default::default()
|
/// ..Default::default()
|
||||||
/// };
|
/// };
|
||||||
///
|
///
|
||||||
/// # let _: Result<(), DbErr> = smol::block_on(async {
|
|
||||||
/// #
|
|
||||||
/// let insert_result = cake::Entity::insert(apple).exec(&db).await?;
|
/// let insert_result = cake::Entity::insert(apple).exec(&db).await?;
|
||||||
///
|
///
|
||||||
/// assert_eq!(dbg!(insert_result.last_insert_id), 150);
|
/// assert_eq!(dbg!(insert_result.last_insert_id), 150);
|
||||||
/// assert!(false);
|
/// assert!(false);
|
||||||
/// #
|
|
||||||
/// # Ok(())
|
|
||||||
/// # });
|
|
||||||
///
|
///
|
||||||
/// assert_eq!(
|
/// assert_eq!(
|
||||||
/// db.into_transaction_log(),
|
/// db.into_transaction_log(),
|
||||||
@ -311,6 +309,9 @@ pub trait EntityTrait: EntityName {
|
|||||||
/// r#"INSERT INTO "cake" ("name") VALUES ($1) RETURNING "id""#,
|
/// r#"INSERT INTO "cake" ("name") VALUES ($1) RETURNING "id""#,
|
||||||
/// vec!["Apple Pie".into()]
|
/// vec!["Apple Pie".into()]
|
||||||
/// )]);
|
/// )]);
|
||||||
|
/// #
|
||||||
|
/// # Ok(())
|
||||||
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// # Example (MySQL)
|
/// # Example (MySQL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user