File tree 4 files changed +9
-9
lines changed 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ cfg_if::cfg_if! {
27
27
}
28
28
29
29
async fn create_tables( connection: & mut AsyncPgConnection ) {
30
-
31
30
diesel:: sql_query( "CREATE TABLE users (
32
31
id SERIAL PRIMARY KEY,
33
32
name VARCHAR NOT NULL
@@ -138,7 +137,7 @@ cfg_if::cfg_if! {
138
137
)" ) . execute( connection) . await . unwrap( ) ;
139
138
140
139
connection. begin_test_transaction( ) . await . unwrap( ) ;
141
- diesel:: sql_query( "INSERT INTO users (name) VALUES ('Sean'), ('Tess')" ) . execute( & mut connection) . await . unwrap( ) ;
140
+ diesel:: sql_query( "INSERT INTO users (name) VALUES ('Sean'), ('Tess')" ) . execute( connection) . await . unwrap( ) ;
142
141
diesel:: sql_query( "INSERT INTO posts (user_id, title) VALUES
143
142
(1, 'My first post'),
144
143
(1, 'About Rust'),
Original file line number Diff line number Diff line change 22
22
//! # #[cfg(feature = "mysql")]
23
23
//! # fn get_config() -> AsyncDieselConnectionManager<diesel_async::AsyncMysqlConnection> {
24
24
//! # let db_url = database_url_from_env("MYSQL_DATABASE_URL");
25
- //! # let config = AsyncDieselConnectionManager::<diesel_async::AsyncMysqlConnection>::new(db_url);
25
+ //! # let config = AsyncDieselConnectionManager::<diesel_async::AsyncMysqlConnection>::new(db_url);
26
26
//! # config
27
27
//! # }
28
28
//! #
32
32
//! let pool = Pool::builder().build(config).await?;
33
33
//! let mut conn = pool.get().await?;
34
34
//! # conn.begin_test_transaction();
35
- //! # clear_tables(&mut conn);
36
- //! # create_tables(&mut conn);
35
+ //! # clear_tables(&mut conn).await;
36
+ //! # create_tables(&mut conn).await;
37
+ //! #[cfg(feature = "mysql")]
37
38
//! # conn.begin_test_transaction();
38
39
//! let res = users.load::<(i32, String)>(&mut conn).await?;
39
40
//! # Ok(())
Original file line number Diff line number Diff line change 32
32
//! let pool = Pool::builder(config).build()?;
33
33
//! let mut conn = pool.get().await?;
34
34
//! # conn.begin_test_transaction();
35
- //! # clear_tables(&mut conn);
36
- //! # create_tables(&mut conn);
35
+ //! # clear_tables(&mut conn).await ;
36
+ //! # create_tables(&mut conn).await ;
37
37
//! # conn.begin_test_transaction();
38
38
//! let res = users.load::<(i32, String)>(&mut conn).await?;
39
39
//! # Ok(())
Original file line number Diff line number Diff line change 32
32
//! let pool = Pool::new(config);
33
33
//! let mut conn = pool.get().await?;
34
34
//! # conn.begin_test_transaction();
35
- //! # clear_tables(&mut conn);
36
- //! # create_tables(&mut conn);
35
+ //! # clear_tables(&mut conn).await ;
36
+ //! # create_tables(&mut conn).await ;
37
37
//! # conn.begin_test_transaction();
38
38
//! let res = users.load::<(i32, String)>(&mut conn).await?;
39
39
//! # Ok(())
You can’t perform that action at this time.
0 commit comments