File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 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! {
2727 }
2828
2929 async fn create_tables( connection: & mut AsyncPgConnection ) {
30-
3130 diesel:: sql_query( "CREATE TABLE users (
3231 id SERIAL PRIMARY KEY,
3332 name VARCHAR NOT NULL
@@ -138,7 +137,7 @@ cfg_if::cfg_if! {
138137 )" ) . execute( connection) . await . unwrap( ) ;
139138
140139 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( ) ;
142141 diesel:: sql_query( "INSERT INTO posts (user_id, title) VALUES
143142 (1, 'My first post'),
144143 (1, 'About Rust'),
Original file line number Diff line number Diff line change 2222//! # #[cfg(feature = "mysql")]
2323//! # fn get_config() -> AsyncDieselConnectionManager<diesel_async::AsyncMysqlConnection> {
2424//! # 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);
2626//! # config
2727//! # }
2828//! #
3232//! let pool = Pool::builder().build(config).await?;
3333//! let mut conn = pool.get().await?;
3434//! # 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")]
3738//! # conn.begin_test_transaction();
3839//! let res = users.load::<(i32, String)>(&mut conn).await?;
3940//! # Ok(())
Original file line number Diff line number Diff line change 3232//! let pool = Pool::builder(config).build()?;
3333//! let mut conn = pool.get().await?;
3434//! # 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 ;
3737//! # conn.begin_test_transaction();
3838//! let res = users.load::<(i32, String)>(&mut conn).await?;
3939//! # Ok(())
Original file line number Diff line number Diff line change 3232//! let pool = Pool::new(config);
3333//! let mut conn = pool.get().await?;
3434//! # 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 ;
3737//! # conn.begin_test_transaction();
3838//! let res = users.load::<(i32, String)>(&mut conn).await?;
3939//! # Ok(())
You can’t perform that action at this time.
0 commit comments