Skip to content

Commit

Permalink
Revert "LibsqlConnector"
Browse files Browse the repository at this point in the history
This reverts commit 71225b1.
  • Loading branch information
miguelff committed Nov 20, 2023
1 parent 71225b1 commit 5665ea3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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()),
}

Expand Down Expand Up @@ -288,7 +287,6 @@ impl TestConfig {
ConnectorVersion::CockroachDb(_) => &CockroachDbConnectorTag,
ConnectorVersion::Vitess(_) => &VitessConnectorTag,
ConnectorVersion::Planetscale => &PlanetscaleConnectorTag,
ConnectorVersion::Libsql => &LibsqlConnectorTag,
};

Ok((tag, version))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod cockroachdb;
mod js;
mod libsql;
mod mongodb;
mod mysql;
mod planetscale;
Expand All @@ -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::*;
Expand Down Expand Up @@ -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")
}
}
}

Expand All @@ -229,7 +218,6 @@ pub enum ConnectorVersion {
CockroachDb(Option<CockroachDbVersion>),
Vitess(Option<VitessVersion>),
Planetscale,
Libsql,
}

impl ConnectorVersion {
Expand All @@ -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(..))
Expand All @@ -266,8 +253,6 @@ impl ConnectorVersion {
| (_, Vitess(..))
| (Planetscale, _)
| (_, Planetscale)
| (Libsql, _)
| (_, Libsql)
| (Postgres(..), _)
| (_, Postgres(..)) => false,
}
Expand Down Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"connector": "libsql",
"connector": "sqlite",
"driver_adapter": "libsql",
"external_test_executor": "default"
}

0 comments on commit 5665ea3

Please sign in to comment.