diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs index 752bfad4b81..320601275fb 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs @@ -1,4 +1,4 @@ -use crate::connector_tag::{LibsqlConnectorTag, PlanetscaleConnectorTag}; +use crate::connector_tag::PlanetscaleConnectorTag; use crate::{ CockroachDbConnectorTag, ConnectorTag, ConnectorVersion, MongoDbConnectorTag, MySqlConnectorTag, PostgresConnectorTag, SqlServerConnectorTag, SqliteConnectorTag, TestResult, VitessConnectorTag, @@ -204,8 +204,7 @@ impl TestConfig { | Ok(ConnectorVersion::CockroachDb(Some(_))) | Ok(ConnectorVersion::Postgres(Some(_))) | Ok(ConnectorVersion::Sqlite) - | Ok(ConnectorVersion::Planetscale) - | Ok(ConnectorVersion::Libsql) => (), + | Ok(ConnectorVersion::Planetscale) => (), Err(err) => exit_with_message(&err.to_string()), } @@ -288,7 +287,6 @@ impl TestConfig { ConnectorVersion::CockroachDb(_) => &CockroachDbConnectorTag, ConnectorVersion::Vitess(_) => &VitessConnectorTag, ConnectorVersion::Planetscale => &PlanetscaleConnectorTag, - ConnectorVersion::Libsql => &LibsqlConnectorTag, }; Ok((tag, version)) diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/libsql.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/libsql.rs deleted file mode 100644 index e414b24fa53..00000000000 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/libsql.rs +++ /dev/null @@ -1,27 +0,0 @@ -use super::*; -use crate::{BoxFuture, SqlDatamodelRenderer}; -use quaint::{prelude::Queryable, single::Quaint}; - -#[derive(Debug, Default)] -pub struct LibsqlConnectorTag; - -impl ConnectorTagInterface for LibsqlConnectorTag { - fn raw_execute<'a>(&'a self, query: &'a str, connection_url: &'a str) -> BoxFuture<'a, Result<(), TestError>> { - Box::pin(async move { - let conn = Quaint::new(connection_url).await?; - Ok(conn.raw_cmd(query).await?) - }) - } - - fn datamodel_provider(&self) -> &'static str { - "sqlite" - } - - fn datamodel_renderer(&self) -> Box { - Box::new(SqlDatamodelRenderer::new()) - } - - fn capabilities(&self) -> ConnectorCapabilities { - psl::builtin_connectors::SQLITE.capabilities() - } -} diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs index f2485ba39de..35b32e8cc6f 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs @@ -1,6 +1,5 @@ mod cockroachdb; mod js; -mod libsql; mod mongodb; mod mysql; mod planetscale; @@ -13,7 +12,6 @@ pub use mysql::MySqlVersion; pub(crate) use cockroachdb::*; pub(crate) use js::*; -pub(crate) use libsql::*; pub(crate) use mongodb::*; pub(crate) use mysql::*; pub(crate) use planetscale::*; @@ -205,15 +203,6 @@ pub(crate) fn connection_string( ConnectorVersion::Vitess(None) => unreachable!("A versioned connector must have a concrete version to run."), ConnectorVersion::Planetscale => "mysql://root@localhost:33577/test".into(), - - ConnectorVersion::Libsql => { - let workspace_root = std::env::var("WORKSPACE_ROOT") - .unwrap_or_else(|_| ".".to_owned()) - .trim_end_matches('/') - .to_owned(); - - format!("file://{workspace_root}/db/{database}.db") - } } } @@ -229,7 +218,6 @@ pub enum ConnectorVersion { CockroachDb(Option), Vitess(Option), Planetscale, - Libsql, } impl ConnectorVersion { @@ -252,7 +240,6 @@ impl ConnectorVersion { (Vitess(a), Vitess(b)) => versions_match(a, b), (Sqlite, Sqlite) => true, (Planetscale, Planetscale) => true, - (Libsql, Libsql) => true, (MongoDb(..), _) | (_, MongoDb(..)) @@ -266,8 +253,6 @@ impl ConnectorVersion { | (_, Vitess(..)) | (Planetscale, _) | (_, Planetscale) - | (Libsql, _) - | (_, Libsql) | (Postgres(..), _) | (_, Postgres(..)) => false, } @@ -300,7 +285,6 @@ impl fmt::Display for ConnectorVersion { }, Self::CockroachDb(_) => "CockroachDB".to_string(), Self::Planetscale => "Planetscale".to_string(), - Self::Libsql => "Libsql".to_string(), }; write!(f, "{printable}") diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/planetscale.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/planetscale.rs index 3d61f3dad99..459bea683e4 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/planetscale.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/planetscale.rs @@ -2,6 +2,15 @@ use super::*; use crate::{BoxFuture, SqlDatamodelRenderer}; use quaint::{prelude::Queryable, single::Quaint}; +/// Connector tag for the PlanetScale connector. +/// It differs from any other connector tag for driver adapters. +/// +/// In driver adapters, the usual way to connect to a database is to use the connector of the +/// cannonical provider for the SQL dialect for which the driver adapters are compatible with. +/// For instance, in the case of neon, the connector tag is PostgresConnectorTag; in the case of +/// libsql, the connector tag is SqliteConnectorTag. +/// +/// Here we take a different approach, planetscale is vitess on the cloud, but in order to make #[derive(Debug, Default)] pub struct PlanetscaleConnectorTag; diff --git a/query-engine/connector-test-kit-rs/test-configs/libsql-sqlite b/query-engine/connector-test-kit-rs/test-configs/libsql-sqlite index 6d246c5b950..9638e3a2284 100644 --- a/query-engine/connector-test-kit-rs/test-configs/libsql-sqlite +++ b/query-engine/connector-test-kit-rs/test-configs/libsql-sqlite @@ -1,5 +1,5 @@ { - "connector": "libsql", + "connector": "sqlite", "driver_adapter": "libsql", "external_test_executor": "default" } \ No newline at end of file