Skip to content

Commit 7266ca4

Browse files
authored
Merge pull request #12 from weiznich/fix_ci
Update some database installations on ci
2 parents 056dd7b + 892c495 commit 7266ca4

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,19 @@ jobs:
7777
if: runner.os == 'macOS' && matrix.backend == 'mysql'
7878
run: |
7979
brew update
80-
brew install mariadb@10.5
81-
/usr/local/opt/mariadb@10.5/bin/mysql_install_db
82-
/usr/local/opt/mariadb@10.5/bin/mysql.server start
80+
brew install mariadb@10.8
81+
/usr/local/opt/mariadb@10.8/bin/mysql_install_db
82+
/usr/local/opt/mariadb@10.8/bin/mysql.server start
8383
sleep 3
84-
/usr/local/opt/[email protected]/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'runner'@'localhost';" -urunner
85-
echo "DATABASE_URL=mysql://runner@localhost/diesel_test" >> $GITHUB_ENV
84+
/usr/local/opt/[email protected]/bin/mysql -e "ALTER USER 'runner'@'localhost' IDENTIFIED BY 'diesel';" -urunner
85+
/usr/local/opt/[email protected]/bin/mysql -e "create database diesel_test; create database diesel_unit_test; grant all on \`diesel_%\`.* to 'runner'@'localhost';" -urunner -pdiesel
86+
echo "DATABASE_URL=mysql://runner:diesel@localhost/diesel_test" >> $GITHUB_ENV
8687
8788
- name: Install postgres (Windows)
8889
if: runner.os == 'Windows' && matrix.backend == 'postgres'
8990
shell: bash
9091
run: |
91-
choco install postgresql12 --force --params '/Password:root'
92-
echo "C:\Program Files\PostgreSQL\12\bin" >> $GITHUB_PATH
93-
echo "C:\Program Files\PostgreSQL\12\lib" >> $GITHUB_PATH
92+
choco install postgresql14 --force --params '/Password:root'
9493
echo "DATABASE_URL=postgres://postgres:root@localhost/" >> $GITHUB_ENV
9594
9695
- name: Install mysql (Windows)
@@ -130,7 +129,7 @@ jobs:
130129
- uses: actions/checkout@v2
131130
- uses: actions-rs/toolchain@v1
132131
with:
133-
toolchain: 1.54.0
132+
toolchain: stable
134133
profile: minimal
135134
components: clippy, rustfmt
136135
override: true

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ use futures::{Future, Stream};
7272
mod mysql;
7373
#[cfg(feature = "postgres")]
7474
mod pg;
75+
#[cfg(any(feature = "deadpool", feature = "bb8", feature = "mobc"))]
76+
pub mod pooled_connection;
7577
mod run_query_dsl;
7678
mod stmt_cache;
7779
mod transaction_manager;
78-
#[cfg(any(feature = "deadpool", feature = "bb8", feature = "mobc"))]
79-
pub mod pooled_connection;
8080

8181
#[cfg(feature = "mysql")]
8282
pub use self::mysql::AsyncMysqlConnection;

src/pooled_connection/mod.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//! * [bb8](self::bb8)
77
//! * [mobc](self::mobc)
88
9-
use crate::{AsyncConnection, AsyncConnectionGatWorkaround, SimpleAsyncConnection};
109
use crate::TransactionManager;
10+
use crate::{AsyncConnection, AsyncConnectionGatWorkaround, SimpleAsyncConnection};
1111
use std::fmt;
1212
use std::marker::PhantomData;
1313
use std::ops::DerefMut;
@@ -60,7 +60,7 @@ impl<C> AsyncDieselConnectionManager<C> {
6060
pub fn new(connection_url: impl Into<String>) -> Self {
6161
Self {
6262
p: PhantomData,
63-
connection_url: connection_url.into()
63+
connection_url: connection_url.into(),
6464
}
6565
}
6666
}
@@ -98,12 +98,13 @@ where
9898
{
9999
type Backend = <C::Target as AsyncConnection>::Backend;
100100

101-
type TransactionManager = PoolTransactionManager<<C::Target as AsyncConnection>::TransactionManager>;
101+
type TransactionManager =
102+
PoolTransactionManager<<C::Target as AsyncConnection>::TransactionManager>;
102103

103104
async fn establish(_database_url: &str) -> diesel::ConnectionResult<Self> {
104-
Err(diesel::result::ConnectionError::BadConnection(String::from(
105-
"Cannot directly establish a pooled connection",
106-
)))
105+
Err(diesel::result::ConnectionError::BadConnection(
106+
String::from("Cannot directly establish a pooled connection"),
107+
))
107108
}
108109

109110
fn load<'conn, 'query, T>(

0 commit comments

Comments
 (0)