MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / execute_unprepared

Function execute_unprepared

tests/execute_unprepared_tests.rs:19–38  ·  view source on GitHub ↗
(db: &DatabaseConnection)

Source from the content-addressed store, hash-verified

17}
18
19pub async fn execute_unprepared(db: &DatabaseConnection) -> Result<(), DbErr> {
20 use insert_default::*;
21
22 db.execute_unprepared(
23 [
24 "INSERT INTO insert_default (id) VALUES (1), (2), (3), (4), (5)",
25 "DELETE FROM insert_default WHERE id % 2 = 0",
26 ]
27 .join(";")
28 .as_str(),
29 )
30 .await?;
31
32 assert_eq!(
33 Entity::find().all(db).await?,
34 [Model { id: 1 }, Model { id: 3 }, Model { id: 5 }]
35 );
36
37 Ok(())
38}

Callers 1

mainFunction · 0.85

Calls 3

joinMethod · 0.80
execute_unpreparedMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected