File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ use criterion::Criterion;
33use criterion:: { criterion_group, criterion_main} ;
44
55use sqlx:: sqlite:: { Sqlite , SqliteConnection } ;
6+ use sqlx:: SqlSafeStr ;
67use sqlx:: Executor ;
78use sqlx_test:: new;
89
910// Here we have an async function to benchmark
1011async fn do_describe_trivial ( db : & std:: cell:: RefCell < SqliteConnection > ) {
11- db. borrow_mut ( ) . describe ( "select 1" ) . await . unwrap ( ) ;
12+ db. borrow_mut ( ) . describe ( "select 1" . into_sql_str ( ) ) . await . unwrap ( ) ;
1213}
1314
1415async fn do_describe_recursive ( db : & std:: cell:: RefCell < SqliteConnection > ) {
@@ -27,22 +28,22 @@ async fn do_describe_recursive(db: &std::cell::RefCell<SqliteConnection>) {
2728 begin_date
2829 FROM schedule
2930 GROUP BY begin_date
30- "# ,
31+ "# . into_sql_str ( ) ,
3132 )
3233 . await
3334 . unwrap ( ) ;
3435}
3536
3637async fn do_describe_insert ( db : & std:: cell:: RefCell < SqliteConnection > ) {
3738 db. borrow_mut ( )
38- . describe ( "INSERT INTO tweet (id, text) VALUES (2, 'Hello') RETURNING *" )
39+ . describe ( "INSERT INTO tweet (id, text) VALUES (2, 'Hello') RETURNING *" . into_sql_str ( ) )
3940 . await
4041 . unwrap ( ) ;
4142}
4243
4344async fn do_describe_insert_fks ( db : & std:: cell:: RefCell < SqliteConnection > ) {
4445 db. borrow_mut ( )
45- . describe ( "insert into statements (text) values ('a') returning id" )
46+ . describe ( "insert into statements (text) values ('a') returning id" . into_sql_str ( ) )
4647 . await
4748 . unwrap ( ) ;
4849}
You can’t perform that action at this time.
0 commit comments