From d90ca61db3fca8fa31c0c4a0a4d813f19fb61cbd Mon Sep 17 00:00:00 2001 From: Lucian Buzzo Date: Mon, 25 Nov 2024 14:38:21 +0000 Subject: [PATCH 1/9] fix(tests): add test for transaction isolation level on mssql --- quaint/src/tests/query.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/quaint/src/tests/query.rs b/quaint/src/tests/query.rs index 6e83297a9a75..ff3b1e00e7bc 100644 --- a/quaint/src/tests/query.rs +++ b/quaint/src/tests/query.rs @@ -115,6 +115,32 @@ async fn transactions_with_isolation_works(api: &mut dyn TestApi) -> crate::Resu Ok(()) } +#[test_each_connector(tags("mssql"))] +async fn mssql_transaction_isolation_level(api: &mut dyn TestApi) -> crate::Result<()> { + // For Mssql, the isolation level is set on the connection and lives until it's changed. + // We need to test that the isolation level set per transaction is ignored. + let table = api.create_temp_table("id int, value int").await?; + + // The connection default is "READ COMMITTED" + let conn = api.conn(); + + // Start a transaction with the default isolation level of "READ COMMITTED" + // and insert a row, but do not commit the transaction + let tx_a = conn.start_transaction(None).await?; + let insert = Insert::single_into(&table).value("value", 3).value("id", 4); + let rows_affected = tx_a.execute(insert.into()).await?; + assert_eq!(1, rows_affected); + + // Start a transaction with an explicit isolation level of "READ UNCOMMITTED", which would ordinarily allow you to read + // rows that have been added but not committed. + let tx_b = conn.start_transaction(Some(IsolationLevel::ReadUncommitted)).await?; + let res = tx_b.query(Select::from_table(&table).into()).await?; + + // The query should return an empty result set because the isolation level is set on the connection + assert_eq!(0, res.len()); + Ok(()) +} + // SQLite only supports serializable. #[test_each_connector(tags("sqlite"))] async fn sqlite_serializable_tx(api: &mut dyn TestApi) -> crate::Result<()> { From 018eae3d30d365c114415f6ad879a75978eec199 Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Tue, 26 Nov 2024 17:10:49 +0000 Subject: [PATCH 2/9] fix: fix isolation level issue in mssql --- quaint/src/single.rs | 22 +++++++++++++++------- quaint/src/tests/query.rs | 28 +++++++++++++++------------- quaint/src/tests/test_api/mssql.rs | 4 ++++ 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/quaint/src/single.rs b/quaint/src/single.rs index 13be8c4bc857..004b84e0da54 100644 --- a/quaint/src/single.rs +++ b/quaint/src/single.rs @@ -2,7 +2,7 @@ use crate::{ ast, - connector::{self, impl_default_TransactionCapable, ConnectionInfo, IsolationLevel, Queryable, TransactionCapable}, + connector::{self, ConnectionInfo, IsolationLevel, Queryable, TransactionCapable}, }; use async_trait::async_trait; use std::{fmt, sync::Arc}; @@ -16,7 +16,7 @@ use crate::connector::NativeConnectionInfo; /// The main entry point and an abstraction over a database connection. #[derive(Clone)] pub struct Quaint { - inner: Arc, + inner: Arc, connection_info: Arc, } @@ -26,7 +26,15 @@ impl fmt::Debug for Quaint { } } -impl_default_TransactionCapable!(Quaint); +#[async_trait] +impl TransactionCapable for Quaint { + async fn start_transaction<'a>( + &'a self, + isolation: Option, + ) -> crate::Result> { + self.inner.start_transaction(isolation).await + } +} impl Quaint { /// Create a new connection to the database. The connection string @@ -137,28 +145,28 @@ impl Quaint { let params = connector::SqliteParams::try_from(s)?; let sqlite = connector::Sqlite::new(¶ms.file_path)?; - Arc::new(sqlite) as Arc + Arc::new(sqlite) as Arc } #[cfg(feature = "mysql-native")] s if s.starts_with("mysql") => { let url = connector::MysqlUrl::new(url::Url::parse(s)?)?; let mysql = connector::Mysql::new(url).await?; - Arc::new(mysql) as Arc + Arc::new(mysql) as Arc } #[cfg(feature = "postgresql-native")] s if s.starts_with("postgres") || s.starts_with("postgresql") => { let url = connector::PostgresNativeUrl::new(url::Url::parse(s)?)?; let tls_manager = connector::MakeTlsConnectorManager::new(url.clone()); let psql = connector::PostgreSql::new(url, &tls_manager).await?; - Arc::new(psql) as Arc + Arc::new(psql) as Arc } #[cfg(feature = "mssql-native")] s if s.starts_with("jdbc:sqlserver") | s.starts_with("sqlserver") => { let url = connector::MssqlUrl::new(s)?; let psql = connector::Mssql::new(url).await?; - Arc::new(psql) as Arc + Arc::new(psql) as Arc } _ => unimplemented!("Supported url schemes: file or sqlite, mysql, postgresql or jdbc:sqlserver."), }; diff --git a/quaint/src/tests/query.rs b/quaint/src/tests/query.rs index ff3b1e00e7bc..61ed9e0b2b1c 100644 --- a/quaint/src/tests/query.rs +++ b/quaint/src/tests/query.rs @@ -117,27 +117,29 @@ async fn transactions_with_isolation_works(api: &mut dyn TestApi) -> crate::Resu #[test_each_connector(tags("mssql"))] async fn mssql_transaction_isolation_level(api: &mut dyn TestApi) -> crate::Result<()> { - // For Mssql, the isolation level is set on the connection and lives until it's changed. - // We need to test that the isolation level set per transaction is ignored. let table = api.create_temp_table("id int, value int").await?; - // The connection default is "READ COMMITTED" - let conn = api.conn(); - - // Start a transaction with the default isolation level of "READ COMMITTED" - // and insert a row, but do not commit the transaction - let tx_a = conn.start_transaction(None).await?; + let conn_a = api.conn(); + // Start a transaction with the default isolation level, which in tests is + // set to READ UNCOMMITED via the DB url and insert a row, but do not commit the transaction + let tx_a = conn_a.start_transaction(None).await?; let insert = Insert::single_into(&table).value("value", 3).value("id", 4); let rows_affected = tx_a.execute(insert.into()).await?; assert_eq!(1, rows_affected); - // Start a transaction with an explicit isolation level of "READ UNCOMMITTED", which would ordinarily allow you to read - // rows that have been added but not committed. - let tx_b = conn.start_transaction(Some(IsolationLevel::ReadUncommitted)).await?; + let conn_b = api.create_additional_connection().await?; + // Start a transaction that explicitly sets the isolation level to "SNAPSHOT" and query the table + // expecting to see the old state. + let tx_b = conn_b.start_transaction(Some(IsolationLevel::Snapshot)).await?; let res = tx_b.query(Select::from_table(&table).into()).await?; - - // The query should return an empty result set because the isolation level is set on the connection assert_eq!(0, res.len()); + + // Start a transaction without an explicit isolation level, it should be run with the default + // again, which is set to READ UNCOMMITED here. + let tx_c = conn_b.start_transaction(None).await?; + let res = tx_c.query(Select::from_table(&table).into()).await?; + assert_eq!(1, res.len()); + Ok(()) } diff --git a/quaint/src/tests/test_api/mssql.rs b/quaint/src/tests/test_api/mssql.rs index 164b3fb7ddeb..5d31757d756c 100644 --- a/quaint/src/tests/test_api/mssql.rs +++ b/quaint/src/tests/test_api/mssql.rs @@ -21,6 +21,10 @@ impl<'a> MsSql<'a> { let names = Generator::default(); let conn = Quaint::new(&CONN_STR).await?; + // snapshot isolation enables us to test isolation levels easily + conn.raw_cmd(&format!("ALTER DATABASE tempdb SET ALLOW_SNAPSHOT_ISOLATION ON",)) + .await?; + Ok(Self { names, conn }) } } From 5a7c078fa4b91ec28300fcb54be0963bfa9c5d3f Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Wed, 27 Nov 2024 10:45:46 +0000 Subject: [PATCH 3/9] chore: address PR comments, extend the fix to PooledConnection --- quaint/src/pooled/manager.rs | 14 +++++++++--- quaint/src/tests/query.rs | 32 ++++++++++++++++----------- quaint/src/tests/test_api.rs | 1 + quaint/src/tests/test_api/mssql.rs | 6 ++++- quaint/src/tests/test_api/mysql.rs | 4 ++++ quaint/src/tests/test_api/postgres.rs | 4 ++++ quaint/src/tests/test_api/sqlite.rs | 4 ++++ 7 files changed, 48 insertions(+), 17 deletions(-) diff --git a/quaint/src/pooled/manager.rs b/quaint/src/pooled/manager.rs index bf4d50eeea87..8a9715640579 100644 --- a/quaint/src/pooled/manager.rs +++ b/quaint/src/pooled/manager.rs @@ -13,7 +13,7 @@ use crate::connector::MysqlUrl; use crate::connector::{MakeTlsConnectorManager, PostgresNativeUrl}; use crate::{ ast, - connector::{self, impl_default_TransactionCapable, IsolationLevel, Queryable, Transaction, TransactionCapable}, + connector::{self, IsolationLevel, Queryable, Transaction, TransactionCapable}, error::Error, }; @@ -23,7 +23,15 @@ pub struct PooledConnection { pub(crate) inner: MobcPooled, } -impl_default_TransactionCapable!(PooledConnection); +#[async_trait] +impl TransactionCapable for PooledConnection { + async fn start_transaction<'a>( + &'a self, + isolation: Option, + ) -> crate::Result> { + self.inner.start_transaction(isolation).await + } +} #[async_trait] impl Queryable for PooledConnection { @@ -104,7 +112,7 @@ pub enum QuaintManager { #[async_trait] impl Manager for QuaintManager { - type Connection = Box; + type Connection = Box; type Error = Error; async fn connect(&self) -> crate::Result { diff --git a/quaint/src/tests/query.rs b/quaint/src/tests/query.rs index 61ed9e0b2b1c..91fb5b2985a2 100644 --- a/quaint/src/tests/query.rs +++ b/quaint/src/tests/query.rs @@ -121,24 +121,30 @@ async fn mssql_transaction_isolation_level(api: &mut dyn TestApi) -> crate::Resu let conn_a = api.conn(); // Start a transaction with the default isolation level, which in tests is - // set to READ UNCOMMITED via the DB url and insert a row, but do not commit the transaction + // set to READ UNCOMMITED via the DB url and insert a row, but do not commit the transaction. let tx_a = conn_a.start_transaction(None).await?; let insert = Insert::single_into(&table).value("value", 3).value("id", 4); let rows_affected = tx_a.execute(insert.into()).await?; assert_eq!(1, rows_affected); - let conn_b = api.create_additional_connection().await?; - // Start a transaction that explicitly sets the isolation level to "SNAPSHOT" and query the table - // expecting to see the old state. - let tx_b = conn_b.start_transaction(Some(IsolationLevel::Snapshot)).await?; - let res = tx_b.query(Select::from_table(&table).into()).await?; - assert_eq!(0, res.len()); - - // Start a transaction without an explicit isolation level, it should be run with the default - // again, which is set to READ UNCOMMITED here. - let tx_c = conn_b.start_transaction(None).await?; - let res = tx_c.query(Select::from_table(&table).into()).await?; - assert_eq!(1, res.len()); + // We want to verify that pooled connection behaves the same way, so we test both cases. + let pool = api.create_pool()?; + for conn_b in [ + Box::new(pool.check_out().await?) as Box, + Box::new(api.create_additional_connection().await?), + ] { + // Start a transaction that explicitly sets the isolation level to SNAPSHOT and query the table + // expecting to see the old state. + let tx_b = conn_b.start_transaction(Some(IsolationLevel::Snapshot)).await?; + let res = tx_b.query(Select::from_table(&table).into()).await?; + assert_eq!(0, res.len()); + + // Start a transaction without an explicit isolation level, it should be run with the default + // again, which is set to READ UNCOMMITED here. + let tx_c = conn_b.start_transaction(None).await?; + let res = tx_c.query(Select::from_table(&table).into()).await?; + assert_eq!(1, res.len()); + } Ok(()) } diff --git a/quaint/src/tests/test_api.rs b/quaint/src/tests/test_api.rs index cd612628d95c..478b68ab64dc 100644 --- a/quaint/src/tests/test_api.rs +++ b/quaint/src/tests/test_api.rs @@ -35,5 +35,6 @@ pub trait TestApi { fn autogen_id(&self, name: &str) -> String; fn conn(&self) -> &crate::single::Quaint; async fn create_additional_connection(&self) -> crate::Result; + fn create_pool(&self) -> crate::Result; fn get_name(&mut self) -> String; } diff --git a/quaint/src/tests/test_api/mssql.rs b/quaint/src/tests/test_api/mssql.rs index 5d31757d756c..5c3da1b843e1 100644 --- a/quaint/src/tests/test_api/mssql.rs +++ b/quaint/src/tests/test_api/mssql.rs @@ -22,7 +22,7 @@ impl<'a> MsSql<'a> { let conn = Quaint::new(&CONN_STR).await?; // snapshot isolation enables us to test isolation levels easily - conn.raw_cmd(&format!("ALTER DATABASE tempdb SET ALLOW_SNAPSHOT_ISOLATION ON",)) + conn.raw_cmd("ALTER DATABASE tempdb SET ALLOW_SNAPSHOT_ISOLATION ON") .await?; Ok(Self { names, conn }) @@ -80,6 +80,10 @@ impl<'a> TestApi for MsSql<'a> { Quaint::new(&CONN_STR).await } + fn create_pool(&self) -> crate::Result { + Ok(crate::pooled::Quaint::builder(&CONN_STR)?.build()) + } + fn render_create_table(&mut self, table_name: &str, columns: &str) -> (String, String) { let table_name = format!("##{table_name}"); let create = format!( diff --git a/quaint/src/tests/test_api/mysql.rs b/quaint/src/tests/test_api/mysql.rs index 764100564fdc..9fcf6337fa82 100644 --- a/quaint/src/tests/test_api/mysql.rs +++ b/quaint/src/tests/test_api/mysql.rs @@ -129,6 +129,10 @@ impl<'a> TestApi for MySql<'a> { Quaint::new(&self.conn_str).await } + fn create_pool(&self) -> crate::Result { + Ok(crate::pooled::Quaint::builder(&CONN_STR)?.build()) + } + fn unique_constraint(&mut self, column: &str) -> String { format!("UNIQUE({column})") } diff --git a/quaint/src/tests/test_api/postgres.rs b/quaint/src/tests/test_api/postgres.rs index 791d8b07b041..339d3a787e85 100644 --- a/quaint/src/tests/test_api/postgres.rs +++ b/quaint/src/tests/test_api/postgres.rs @@ -87,6 +87,10 @@ impl<'a> TestApi for PostgreSql<'a> { Quaint::new(&CONN_STR).await } + fn create_pool(&self) -> crate::Result { + Ok(crate::pooled::Quaint::builder(&CONN_STR)?.build()) + } + fn unique_constraint(&mut self, column: &str) -> String { format!("UNIQUE({column})") } diff --git a/quaint/src/tests/test_api/sqlite.rs b/quaint/src/tests/test_api/sqlite.rs index bde13715d587..b53d6e027a32 100644 --- a/quaint/src/tests/test_api/sqlite.rs +++ b/quaint/src/tests/test_api/sqlite.rs @@ -83,6 +83,10 @@ impl<'a> TestApi for Sqlite<'a> { Quaint::new(CONN_STR).await } + fn create_pool(&self) -> crate::Result { + Ok(crate::pooled::Quaint::builder(&CONN_STR)?.build()) + } + fn unique_constraint(&mut self, column: &str) -> String { format!("UNIQUE({column})") } From ab8a010cd648febbfa8df210d3c955591f40a0c6 Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Wed, 27 Nov 2024 10:59:45 +0000 Subject: [PATCH 4/9] chore: fix a clippy lint --- quaint/src/tests/test_api/sqlite.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quaint/src/tests/test_api/sqlite.rs b/quaint/src/tests/test_api/sqlite.rs index b53d6e027a32..736c04968737 100644 --- a/quaint/src/tests/test_api/sqlite.rs +++ b/quaint/src/tests/test_api/sqlite.rs @@ -84,7 +84,7 @@ impl<'a> TestApi for Sqlite<'a> { } fn create_pool(&self) -> crate::Result { - Ok(crate::pooled::Quaint::builder(&CONN_STR)?.build()) + Ok(crate::pooled::Quaint::builder(CONN_STR)?.build()) } fn unique_constraint(&mut self, column: &str) -> String { From b5ee534ab237edf3c8c7454442e0a375b6bf6235 Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Wed, 27 Nov 2024 11:52:22 +0000 Subject: [PATCH 5/9] chore: feature gate several things to resolve warnings in WASM build --- quaint/src/connector/queryable.rs | 2 ++ quaint/src/connector/transaction.rs | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/quaint/src/connector/queryable.rs b/quaint/src/connector/queryable.rs index 5f0fd54dad6b..580e0099f2d5 100644 --- a/quaint/src/connector/queryable.rs +++ b/quaint/src/connector/queryable.rs @@ -112,6 +112,7 @@ pub trait TransactionCapable: Queryable { ) -> crate::Result>; } +#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] macro_rules! impl_default_TransactionCapable { ($t:ty) => { #[async_trait] @@ -130,4 +131,5 @@ macro_rules! impl_default_TransactionCapable { }; } +#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] pub(crate) use impl_default_TransactionCapable; diff --git a/quaint/src/connector/transaction.rs b/quaint/src/connector/transaction.rs index 599efe1d99fc..aa184afd48d0 100644 --- a/quaint/src/connector/transaction.rs +++ b/quaint/src/connector/transaction.rs @@ -21,6 +21,7 @@ pub trait Transaction: Queryable { fn as_queryable(&self) -> &dyn Queryable; } +#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] pub(crate) struct TransactionOptions { /// The isolation level to use. pub(crate) isolation_level: Option, @@ -29,6 +30,17 @@ pub(crate) struct TransactionOptions { pub(crate) isolation_first: bool, } +#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] +impl TransactionOptions { + pub fn new(isolation_level: Option, isolation_first: bool) -> Self { + Self { + isolation_level, + isolation_first, + } + } +} + + /// A default representation of an SQL database transaction. If not commited, a /// transaction will be rolled back by default when dropped. /// @@ -40,6 +52,7 @@ pub struct DefaultTransaction<'a> { } impl<'a> DefaultTransaction<'a> { + #[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] pub(crate) async fn new( inner: &'a dyn Queryable, begin_stmt: &str, @@ -196,11 +209,3 @@ impl FromStr for IsolationLevel { } } } -impl TransactionOptions { - pub fn new(isolation_level: Option, isolation_first: bool) -> Self { - Self { - isolation_level, - isolation_first, - } - } -} From 6560c62aba22bdd57ff3e7bab02283644dfe27f9 Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Wed, 27 Nov 2024 12:07:18 +0000 Subject: [PATCH 6/9] chore: make rustfmt happy --- quaint/src/connector/transaction.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/quaint/src/connector/transaction.rs b/quaint/src/connector/transaction.rs index aa184afd48d0..96b873c7cdf9 100644 --- a/quaint/src/connector/transaction.rs +++ b/quaint/src/connector/transaction.rs @@ -40,7 +40,6 @@ impl TransactionOptions { } } - /// A default representation of an SQL database transaction. If not commited, a /// transaction will be rolled back by default when dropped. /// From a3d3e91c725cf9b2b2bc60d5470d08ccfbe7f03b Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Wed, 27 Nov 2024 12:12:48 +0000 Subject: [PATCH 7/9] fix: update the query count for MSSQL now that it sets the isolation settings --- .../query-engine-tests/tests/new/metrics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs index 323f162a2111..5e0a510024b3 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs @@ -32,7 +32,7 @@ mod metrics { match runner.connector_version() { Sqlite(_) => assert_eq!(total_queries, 2), - SqlServer(_) => assert_eq!(total_queries, 10), + SqlServer(_) => assert_eq!(total_queries, 12), MongoDb(_) => assert_eq!(total_queries, 5), CockroachDb(_) => assert_eq!(total_queries, 2), MySql(_) => assert_eq!(total_queries, 9), From 2de72ae2a74e8b67a00000450234ee14dc16d213 Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Wed, 27 Nov 2024 12:29:45 +0000 Subject: [PATCH 8/9] fix: add sqlite to feature gates --- quaint/src/connector/queryable.rs | 14 ++++++++++++-- quaint/src/connector/transaction.rs | 21 ++++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/quaint/src/connector/queryable.rs b/quaint/src/connector/queryable.rs index 580e0099f2d5..9d61dea145d8 100644 --- a/quaint/src/connector/queryable.rs +++ b/quaint/src/connector/queryable.rs @@ -112,7 +112,12 @@ pub trait TransactionCapable: Queryable { ) -> crate::Result>; } -#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] +#[cfg(any( + feature = "sqlite-native", + feature = "mssql-native", + feature = "postgresql-native", + feature = "mysql-native" +))] macro_rules! impl_default_TransactionCapable { ($t:ty) => { #[async_trait] @@ -131,5 +136,10 @@ macro_rules! impl_default_TransactionCapable { }; } -#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] +#[cfg(any( + feature = "sqlite-native", + feature = "mssql-native", + feature = "postgresql-native", + feature = "mysql-native" +))] pub(crate) use impl_default_TransactionCapable; diff --git a/quaint/src/connector/transaction.rs b/quaint/src/connector/transaction.rs index 96b873c7cdf9..0d6770f2b83b 100644 --- a/quaint/src/connector/transaction.rs +++ b/quaint/src/connector/transaction.rs @@ -21,7 +21,12 @@ pub trait Transaction: Queryable { fn as_queryable(&self) -> &dyn Queryable; } -#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] +#[cfg(any( + feature = "sqlite-native", + feature = "mssql-native", + feature = "postgresql-native", + feature = "mysql-native" +))] pub(crate) struct TransactionOptions { /// The isolation level to use. pub(crate) isolation_level: Option, @@ -30,7 +35,12 @@ pub(crate) struct TransactionOptions { pub(crate) isolation_first: bool, } -#[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] +#[cfg(any( + feature = "sqlite-native", + feature = "mssql-native", + feature = "postgresql-native", + feature = "mysql-native" +))] impl TransactionOptions { pub fn new(isolation_level: Option, isolation_first: bool) -> Self { Self { @@ -51,7 +61,12 @@ pub struct DefaultTransaction<'a> { } impl<'a> DefaultTransaction<'a> { - #[cfg(any(feature = "mssql-native", feature = "postgresql-native", feature = "mysql-native"))] + #[cfg(any( + feature = "sqlite-native", + feature = "mssql-native", + feature = "postgresql-native", + feature = "mysql-native" + ))] pub(crate) async fn new( inner: &'a dyn Queryable, begin_stmt: &str, From 7098ead11303333243cf9aae82c7b6935a008916 Mon Sep 17 00:00:00 2001 From: Jacek Malec Date: Wed, 27 Nov 2024 15:38:00 +0000 Subject: [PATCH 9/9] fix: default to READ UNCOMMITTED in Quaint test --- .github/workflows/test-quaint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-quaint.yml b/.github/workflows/test-quaint.yml index 62aa722e3955..3ab4045b4e06 100644 --- a/.github/workflows/test-quaint.yml +++ b/.github/workflows/test-quaint.yml @@ -22,7 +22,7 @@ jobs: TEST_MYSQL8: "mysql://root:prisma@localhost:3307/prisma" TEST_MYSQL_MARIADB: "mysql://root:prisma@localhost:3308/prisma" TEST_PSQL: "postgres://postgres:prisma@localhost:5432/postgres" - TEST_MSSQL: "jdbc:sqlserver://localhost:1433;database=master;user=SA;password=;trustServerCertificate=true" + TEST_MSSQL: "jdbc:sqlserver://localhost:1433;database=master;user=SA;password=;trustServerCertificate=true;isolationLevel=READ UNCOMMITTED" TEST_CRDB: "postgresql://prisma@127.0.0.1:26259/postgres" steps: