This will fail loll
This commit is contained in:
parent
afdb1afeb8
commit
17232063b3
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@ -517,7 +517,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: [13.3, 12.7, 11.12, 10.17, 9.6.22]
|
version: [13, 12, 11, 10, 9]
|
||||||
runtime: [tokio]
|
runtime: [tokio]
|
||||||
tls: [native-tls]
|
tls: [native-tls]
|
||||||
services:
|
services:
|
||||||
|
@ -269,6 +269,22 @@ impl DatabaseConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl DatabaseConnection {
|
impl DatabaseConnection {
|
||||||
|
/// Get database version
|
||||||
|
pub fn version(&self) -> String {
|
||||||
|
match self {
|
||||||
|
#[cfg(feature = "sqlx-mysql")]
|
||||||
|
DatabaseConnection::SqlxMySqlPoolConnection { version, .. } => version.to_string(),
|
||||||
|
#[cfg(feature = "sqlx-postgres")]
|
||||||
|
DatabaseConnection::SqlxPostgresPoolConnection(_) => "".to_string(),
|
||||||
|
#[cfg(feature = "sqlx-sqlite")]
|
||||||
|
DatabaseConnection::SqlxSqlitePoolConnection(_) => "".to_string(),
|
||||||
|
#[cfg(feature = "mock")]
|
||||||
|
DatabaseConnection::MockDatabaseConnection(_) => "".to_string(),
|
||||||
|
DatabaseConnection::Disconnected => panic!("Disconnected"),
|
||||||
|
_ => unimplemented!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Check if database supports `RETURNING`
|
/// Check if database supports `RETURNING`
|
||||||
pub fn support_returning(&self) -> bool {
|
pub fn support_returning(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
|
@ -221,6 +221,6 @@ async fn into_db_connection(pool: MySqlPool) -> Result<DatabaseConnection, DbErr
|
|||||||
Ok(DatabaseConnection::SqlxMySqlPoolConnection {
|
Ok(DatabaseConnection::SqlxMySqlPoolConnection {
|
||||||
conn,
|
conn,
|
||||||
version,
|
version,
|
||||||
support_returning: false,
|
support_returning,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ async fn main() -> Result<(), DbErr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create_tables(db).await?;
|
create_tables(db).await?;
|
||||||
|
println!("db_version: {:#?}", db.version());
|
||||||
db.query_one(builder.build(&insert)).await?;
|
db.query_one(builder.build(&insert)).await?;
|
||||||
db.query_one(builder.build(&update)).await?;
|
db.query_one(builder.build(&update)).await?;
|
||||||
assert!(false);
|
assert!(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user