diff --git a/.github/test-configuration.json b/.github/test-configuration.json index ae8fcea1d..e692fe7ab 100644 --- a/.github/test-configuration.json +++ b/.github/test-configuration.json @@ -1,12 +1,4 @@ { - "ndc-citus": { - "package": "ndc-citus", - "flags": "", - "services": "citus", - "env": { - "POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64004" - } - }, "ndc-cockroach": { "package": "ndc-cockroach", "flags": "", diff --git a/.github/workflows/build-images-and-deploy.yaml b/.github/workflows/build-images-and-deploy.yaml index 40498caee..a89ae6425 100644 --- a/.github/workflows/build-images-and-deploy.yaml +++ b/.github/workflows/build-images-and-deploy.yaml @@ -14,7 +14,6 @@ jobs: strategy: matrix: connector: - - ndc-citus - ndc-cockroach - ndc-postgres fail-fast: false diff --git a/.github/workflows/cargo-test.yaml b/.github/workflows/cargo-test.yaml index 03f34bfac..fefaf193b 100644 --- a/.github/workflows/cargo-test.yaml +++ b/.github/workflows/cargo-test.yaml @@ -38,7 +38,6 @@ jobs: strategy: matrix: package: - - ndc-citus - ndc-cockroach - ndc-postgres-12 - ndc-postgres-13 @@ -155,7 +154,12 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }} test-ndc-postgres-with-yugabyte: - name: test connector (ndc-postgres on Yugabyte) + strategy: + matrix: + database: + - yugabyte + - citus + name: "test connector (ndc-postgres on ${{ matrix.database }})" runs-on: ubuntu-latest env: CARGO_NET_GIT_FETCH_WITH_CLI: "true" @@ -183,10 +187,10 @@ jobs: compose-file: "./docker-compose.yaml" down-flags: "--volumes" services: | - yugabyte + ${{ matrix.database }} - name: run tests run: | - cargo nextest run --no-fail-fast --release -p other-db-tests --features yugabyte + cargo nextest run --no-fail-fast --release -p other-db-tests --features ${{ matrix.database }} env: RUST_LOG: INFO diff --git a/Cargo.lock b/Cargo.lock index e201e5b00..b04c3f9c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1408,29 +1408,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "ndc-citus" -version = "0.1.0" -dependencies = [ - "async-trait", - "axum", - "axum-test-helper", - "env_logger", - "hyper", - "insta", - "ndc-client", - "ndc-postgres", - "ndc-sdk", - "ndc-test", - "prometheus", - "reqwest", - "serde_json", - "similar-asserts", - "tests-common", - "tokio", - "tracing", -] - [[package]] name = "ndc-client" version = "0.1.0" @@ -1892,6 +1869,7 @@ dependencies = [ "insta", "ndc-postgres", "ndc-sdk", + "ndc-test", "tests-common", "tokio", ] @@ -3120,13 +3098,20 @@ version = "0.1.0" dependencies = [ "axum", "axum-test-helper", + "hyper", "jsonschema", + "ndc-client", + "ndc-postgres", "ndc-sdk", + "ndc-test", + "reqwest", "schemars", "serde", "serde_derive", "serde_json", + "similar-asserts", "sqlx", + "tokio", "tokio-postgres", "tracing", "uuid", diff --git a/Cargo.toml b/Cargo.toml index 34079fe7b..90a126084 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ package.edition = "2021" package.license = "Apache-2.0" members = [ - "crates/connectors/ndc-citus", "crates/connectors/ndc-cockroach", "crates/connectors/ndc-postgres", "crates/query-engine/execution", diff --git a/crates/connectors/ndc-citus/Cargo.toml b/crates/connectors/ndc-citus/Cargo.toml deleted file mode 100644 index 153a85737..000000000 --- a/crates/connectors/ndc-citus/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "ndc-citus" -version.workspace = true -edition.workspace = true -license.workspace = true - -default-run = "ndc-citus" - -[lib] -name = "ndc_citus" -path = "src/lib.rs" - -[[bin]] -name = "ndc-citus" -path = "bin/main.rs" - -[dependencies] -ndc-sdk = { git = "https://github.com/hasura/ndc-hub.git", rev = "098b1c2", package = "ndc-sdk" } -ndc-postgres = { path = "../ndc-postgres" } - -async-trait = "0.1.74" -prometheus = "0.13.3" -serde_json = { version = "1.0.107", features = ["raw_value"] } -tokio = { version = "1.33.0", features = ["full"] } -tracing = "0.1.40" - -[dev-dependencies] -ndc-client = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.8" } -ndc-test = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.8" } -tests-common = { path = "../../tests/tests-common" } - -axum = "0.6.19" -axum-test-helper = "0.3.0" -env_logger = "0.10.0" -hyper = { version = "0.14.27", features = ["tcp"] } -insta = { version = "1.34.0", features = ["json"] } -reqwest = "0.11.22" -similar-asserts = "1.5.0" diff --git a/crates/connectors/ndc-citus/bin/main.rs b/crates/connectors/ndc-citus/bin/main.rs deleted file mode 100644 index c74711ea4..000000000 --- a/crates/connectors/ndc-citus/bin/main.rs +++ /dev/null @@ -1,7 +0,0 @@ -use ndc_citus::connector::Citus; -use ndc_sdk::default_main::default_main; - -#[tokio::main] -pub async fn main() { - default_main::().await.unwrap() -} diff --git a/crates/connectors/ndc-citus/src/connector.rs b/crates/connectors/ndc-citus/src/connector.rs deleted file mode 100644 index fe87f253f..000000000 --- a/crates/connectors/ndc-citus/src/connector.rs +++ /dev/null @@ -1,167 +0,0 @@ -//! This defines a `Connector` implementation for Citus. -//! -//! The routes are defined here. -//! -//! The relevant types for configuration and state are defined in -//! `super::configuration`. -//! -//! We use the entire implementation from Postgres for the time being, will swap things out as we -//! need to - -use std::sync::Arc; - -use async_trait::async_trait; -use ndc_sdk::connector; -use ndc_sdk::json_response::JsonResponse; -use ndc_sdk::models; - -use ndc_postgres::capabilities; -use ndc_postgres::configuration; -use ndc_postgres::explain; -use ndc_postgres::health; -use ndc_postgres::query; -use ndc_postgres::schema; -use ndc_postgres::state; - -use tracing::{info_span, Instrument}; - -const CONFIGURATION_QUERY: &str = include_str!("../../ndc-postgres/src/configuration.sql"); - -#[derive(Clone, Default)] -pub struct Citus {} - -#[async_trait] -impl connector::Connector for Citus { - /// RawConfiguration is what the user specifies as JSON - type RawConfiguration = configuration::RawConfiguration; - /// The type of validated configuration - type Configuration = Arc; - /// The type of unserializable state - type State = Arc; - - fn make_empty_configuration() -> Self::RawConfiguration { - configuration::RawConfiguration::empty() - } - - /// Configure a configuration maybe? - async fn update_configuration( - args: Self::RawConfiguration, - ) -> Result { - configuration::configure(args, CONFIGURATION_QUERY) - .instrument(info_span!("Update configuration")) - .await - } - - /// Validate the raw configuration provided by the user, - /// returning a configuration error or a validated `Connector::Configuration`. - async fn validate_raw_configuration( - configuration: Self::RawConfiguration, - ) -> Result { - configuration::validate_raw_configuration(configuration) - .instrument(info_span!("Validate raw configuration")) - .await - .map(Arc::new) - } - - /// Initialize the connector's in-memory state. - /// - /// For example, any connection pools, prepared queries, - /// or other managed resources would be allocated here. - /// - /// In addition, this function should register any - /// connector-specific metrics with the metrics registry. - async fn try_init_state( - configuration: &Self::Configuration, - metrics: &mut prometheus::Registry, - ) -> Result { - state::create_state(configuration, metrics) - .instrument(info_span!("Initialise state")) - .await - .map(Arc::new) - .map_err(|err| connector::InitializationError::Other(err.into())) - } - - /// Update any metrics from the state - /// - /// Note: some metrics can be updated directly, and do not - /// need to be updated here. This function can be useful to - /// query metrics which cannot be updated directly, e.g. - /// the number of idle connections in a connection pool - /// can be polled but not updated directly. - fn fetch_metrics( - _configuration: &Self::Configuration, - state: &Self::State, - ) -> Result<(), connector::FetchMetricsError> { - state.metrics.update_pool_metrics(&state.pool); - Ok(()) - } - - /// Check the health of the connector. - /// - /// For example, this function should check that the connector - /// is able to reach its data source over the network. - async fn health_check( - _configuration: &Self::Configuration, - state: &Self::State, - ) -> Result<(), connector::HealthError> { - health::health_check(&state.pool).await - } - - /// Get the connector's capabilities. - /// - /// This function implements the [capabilities endpoint](https://hasura.github.io/ndc-spec/specification/capabilities.html) - /// from the NDC specification. - async fn get_capabilities() -> JsonResponse { - capabilities::get_capabilities().into() - } - - /// Get the connector's schema. - /// - /// This function implements the [schema endpoint](https://hasura.github.io/ndc-spec/specification/schema/index.html) - /// from the NDC specification. - async fn get_schema( - configuration: &Self::Configuration, - ) -> Result, connector::SchemaError> { - schema::get_schema(configuration).await.map(Into::into) - } - - /// Explain a query by creating an execution plan - /// - /// This function implements the [explain endpoint](https://hasura.github.io/ndc-spec/specification/explain.html) - /// from the NDC specification. - async fn explain( - configuration: &Self::Configuration, - state: &Self::State, - query_request: models::QueryRequest, - ) -> Result, connector::ExplainError> { - let conf = &configuration.as_runtime_configuration(); - explain::explain(conf, state, query_request) - .await - .map(Into::into) - } - - /// Execute a mutation - /// - /// This function implements the [mutation endpoint](https://hasura.github.io/ndc-spec/specification/mutations/index.html) - /// from the NDC specification. - async fn mutation( - _configuration: &Self::Configuration, - _state: &Self::State, - _request: models::MutationRequest, - ) -> Result, connector::MutationError> { - todo!("mutations are currently not implemented") - } - - /// Execute a query - /// - /// This function implements the [query endpoint](https://hasura.github.io/ndc-spec/specification/queries/index.html) - /// from the NDC specification. - async fn query( - configuration: &Self::Configuration, - state: &Self::State, - query_request: models::QueryRequest, - ) -> Result, connector::QueryError> { - let conf = &configuration.as_runtime_configuration(); - query::query(conf, state, query_request).await - } -} diff --git a/crates/connectors/ndc-citus/src/lib.rs b/crates/connectors/ndc-citus/src/lib.rs deleted file mode 100644 index af40aaa72..000000000 --- a/crates/connectors/ndc-citus/src/lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -//! A Hasura v3 Citus Native Data Connector, based on ndc-postgres. - -pub mod connector; diff --git a/crates/connectors/ndc-citus/tests/explain_tests.rs b/crates/connectors/ndc-citus/tests/explain_tests.rs deleted file mode 100644 index 96900a98e..000000000 --- a/crates/connectors/ndc-citus/tests/explain_tests.rs +++ /dev/null @@ -1,33 +0,0 @@ -pub mod common; - -use common::create_router; -use tests_common::assert::is_contained_in_lines; -use tests_common::request::run_explain; - -#[tokio::test] -async fn select_by_pk() { - let result = run_explain(create_router().await, "select_by_pk").await; - is_contained_in_lines(vec!["Aggregate", "Scan", "35"], result.details.plan); - insta::assert_snapshot!(result.details.query); -} - -#[tokio::test] -async fn select_where_variable() { - let result = run_explain(create_router().await, "select_where_variable").await; - is_contained_in_lines(vec!["Aggregate", "Seq Scan", "Filter"], result.details.plan); - insta::assert_snapshot!(result.details.query); -} - -#[tokio::test] -async fn select_where_name_nilike() { - let result = run_explain(create_router().await, "select_where_name_nilike").await; - let keywords = vec![ - "Aggregate", - "Subquery Scan", - "Limit", - "Index Scan", - "Filter", - ]; - is_contained_in_lines(keywords, result.details.plan); - insta::assert_snapshot!(result.details.query); -} diff --git a/crates/connectors/ndc-citus/tests/schema_tests.rs b/crates/connectors/ndc-citus/tests/schema_tests.rs deleted file mode 100644 index 664594eee..000000000 --- a/crates/connectors/ndc-citus/tests/schema_tests.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub mod common; - -#[tokio::test] -async fn get_schema() { - let result = tests_common::request::get_schema(common::create_router().await).await; - insta::assert_json_snapshot!(result); -} diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_less_than.snap b/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_less_than.snap deleted file mode 100644 index 3f1990fb7..000000000 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_less_than.snap +++ /dev/null @@ -1,9 +0,0 @@ ---- -source: crates/connectors/ndc-citus/tests/query_tests.rs -expression: result ---- -[ - { - "rows": [] - } -] diff --git a/crates/tests/other-db-tests/Cargo.toml b/crates/tests/other-db-tests/Cargo.toml index e616ad62f..7981f40df 100644 --- a/crates/tests/other-db-tests/Cargo.toml +++ b/crates/tests/other-db-tests/Cargo.toml @@ -12,12 +12,16 @@ aurora = [] # We only run the Yugabyte tests if this feature is enabled. # Note that the Yugabyte Docker image seems not to work on aarch64. yugabyte = [] +# We only run the Cockroach tests if this feature is enabled. +cockroach = [] +# We only run the Citus tests if this feature is enabled. +citus = [] [dependencies] - -tests-common = { path = "../tests-common" } -ndc-sdk = { git = "https://github.com/hasura/ndc-hub.git", rev = "098b1c2", package = "ndc-sdk" } ndc-postgres = { path = "../../connectors/ndc-postgres" } +ndc-sdk = { git = "https://github.com/hasura/ndc-hub.git", rev = "098b1c2", package = "ndc-sdk" } +ndc-test = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.8" } +tests-common = { path = "../tests-common" } axum = "0.6.19" env_logger = "0.10.0" diff --git a/crates/connectors/ndc-citus/tests/common/mod.rs b/crates/tests/other-db-tests/src/citus/common.rs similarity index 90% rename from crates/connectors/ndc-citus/tests/common/mod.rs rename to crates/tests/other-db-tests/src/citus/common.rs index c1aed6e0f..9b3a693b1 100644 --- a/crates/connectors/ndc-citus/tests/common/mod.rs +++ b/crates/tests/other-db-tests/src/citus/common.rs @@ -1,9 +1,10 @@ //! Common functions used across test cases. -use ndc_citus::connector; +use ndc_postgres::connector; pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/citus/chinook-deployment.json"; -pub const POSTGRESQL_CONNECTION_STRING: &str = + +pub const CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64004?sslmode=disable"; /// Creates a router with a fresh state from the test deployment. @@ -15,7 +16,7 @@ pub async fn create_router() -> axum::Router { tests_common::deployment::helpers::get_path_from_project_root(CHINOOK_DEPLOYMENT_PATH); // initialise server state with the static configuration. - let state = ndc_sdk::default_main::init_server_state::( + let state = ndc_sdk::default_main::init_server_state::( test_deployment_file.display().to_string(), ) .await; diff --git a/crates/tests/other-db-tests/src/citus/configuration_tests.rs b/crates/tests/other-db-tests/src/citus/configuration_tests.rs new file mode 100644 index 000000000..0ffe5f08e --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/configuration_tests.rs @@ -0,0 +1,25 @@ +//! Tests that configuration generation has not changed. +//! +//! If you have changed it intentionally, run `just generate-chinook-configuration`. + +#[cfg(test)] +mod configuration_tests { + use super::super::common; + use tests_common::common_tests; + + #[tokio::test] + async fn test_configure() { + common_tests::configuration_tests::test_configure( + common::CONNECTION_STRING, + common::CHINOOK_DEPLOYMENT_PATH, + ) + .await + } + + #[test] + fn configuration_conforms_to_the_schema() { + common_tests::configuration_tests::configuration_conforms_to_the_schema( + common::CHINOOK_DEPLOYMENT_PATH, + ) + } +} diff --git a/crates/tests/other-db-tests/src/citus/explain_tests.rs b/crates/tests/other-db-tests/src/citus/explain_tests.rs new file mode 100644 index 000000000..f6b35a47e --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/explain_tests.rs @@ -0,0 +1,34 @@ +#[cfg(test)] +mod explain { + use super::super::common::create_router; + use tests_common::assert::is_contained_in_lines; + use tests_common::request::run_explain; + + #[tokio::test] + async fn select_by_pk() { + let result = run_explain(create_router().await, "select_by_pk").await; + is_contained_in_lines(vec!["Aggregate", "Scan", "35"], result.details.plan); + insta::assert_snapshot!(result.details.query); + } + + #[tokio::test] + async fn select_where_variable() { + let result = run_explain(create_router().await, "select_where_variable").await; + is_contained_in_lines(vec!["Aggregate", "Seq Scan", "Filter"], result.details.plan); + insta::assert_snapshot!(result.details.query); + } + + #[tokio::test] + async fn select_where_name_nilike() { + let result = run_explain(create_router().await, "select_where_name_nilike").await; + let keywords = vec![ + "Aggregate", + "Subquery Scan", + "Limit", + "Index Scan", + "Filter", + ]; + is_contained_in_lines(keywords, result.details.plan); + insta::assert_snapshot!(result.details.query); + } +} diff --git a/crates/tests/other-db-tests/src/citus/mod.rs b/crates/tests/other-db-tests/src/citus/mod.rs new file mode 100644 index 000000000..7d7112057 --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/mod.rs @@ -0,0 +1,6 @@ +pub mod common; +pub mod configuration_tests; +pub mod explain_tests; +pub mod ndc_tests; +pub mod query_tests; +pub mod schema_tests; diff --git a/crates/tests/other-db-tests/src/citus/ndc_tests.rs b/crates/tests/other-db-tests/src/citus/ndc_tests.rs new file mode 100644 index 000000000..ac675f2dc --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/ndc_tests.rs @@ -0,0 +1,13 @@ +//! Runs the tests provided by the ndc-spec. + +#[cfg(test)] +mod ndc_tests { + use super::super::common; + use tests_common::common_tests; + + #[tokio::test] + async fn test_connector() -> Result<(), Vec> { + let router = common::create_router().await; + common_tests::ndc_tests::test_connector(router).await + } +} diff --git a/crates/connectors/ndc-citus/tests/query_tests.rs b/crates/tests/other-db-tests/src/citus/query_tests.rs similarity index 94% rename from crates/connectors/ndc-citus/tests/query_tests.rs rename to crates/tests/other-db-tests/src/citus/query_tests.rs index 660ced599..ebc75a0fc 100644 --- a/crates/connectors/ndc-citus/tests/query_tests.rs +++ b/crates/tests/other-db-tests/src/citus/query_tests.rs @@ -1,9 +1,7 @@ -pub mod common; -use tests_common::request::run_query; - +#[cfg(test)] mod basic { - use super::common::create_router; - use super::run_query; + use super::super::common::create_router; + use tests_common::request::run_query; #[tokio::test] async fn select_by_pk() { @@ -24,9 +22,10 @@ mod basic { } } +#[cfg(test)] mod predicates { - use super::common::create_router; - use super::run_query; + use super::super::common::create_router; + use tests_common::request::run_query; #[tokio::test] async fn select_where_name_like() { @@ -175,9 +174,10 @@ mod predicates { } } +#[cfg(test)] mod sorting { - use super::common::create_router; - use super::run_query; + use super::super::common::create_router; + use tests_common::request::run_query; #[tokio::test] async fn select_order_by_name() { @@ -232,6 +232,7 @@ mod sorting { .await; insta::assert_json_snapshot!(result); } + #[tokio::test] async fn sorting_by_nested_relationship_column_with_predicate() { let result = run_query( @@ -242,8 +243,6 @@ mod sorting { insta::assert_json_snapshot!(result); } - // Citus sorts strings differently than PostgreSQL, - // so the 5th row might be different. #[tokio::test] async fn sorting_by_nested_relationship_column_with_predicate_exists() { let result = run_query( @@ -265,9 +264,10 @@ mod sorting { } } +#[cfg(test)] mod aggregation { - use super::common::create_router; - use super::run_query; + use super::super::common::create_router; + use tests_common::request::run_query; #[tokio::test] async fn aggregate_count_albums() { @@ -298,9 +298,10 @@ mod aggregation { } } +#[cfg(test)] mod relationships { - use super::common::create_router; - use super::run_query; + use super::super::common::create_router; + use tests_common::request::run_query; #[tokio::test] async fn select_album_object_relationship_to_artist() { @@ -347,9 +348,10 @@ mod relationships { } } +#[cfg(test)] mod native_queries { - use super::common::create_router; - use super::run_query; + use super::super::common::create_router; + use tests_common::request::run_query; #[tokio::test] async fn select_artist() { @@ -410,8 +412,8 @@ mod native_queries { #[cfg(test)] mod types { - use super::common::create_router; - use super::run_query; + use super::super::common::create_router; + use tests_common::request::run_query; #[tokio::test] async fn select_value_types() { diff --git a/crates/tests/other-db-tests/src/citus/schema_tests.rs b/crates/tests/other-db-tests/src/citus/schema_tests.rs new file mode 100644 index 000000000..ef42c079e --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/schema_tests.rs @@ -0,0 +1,9 @@ +#[cfg(test)] +mod schema_test { + use super::super::common; + #[tokio::test] + async fn get_schema() { + let result = tests_common::request::get_schema(common::create_router().await).await; + insta::assert_json_snapshot!(result); + } +} diff --git a/crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_by_pk.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_by_pk.snap similarity index 88% rename from crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_by_pk.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_by_pk.snap index 8401c7d71..8f1a541b2 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_by_pk.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_by_pk.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/explain_tests.rs +source: crates/tests/other-db-tests/src/citus/explain_tests.rs expression: result.details.query --- EXPLAIN diff --git a/crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_where_name_nilike.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_where_name_nilike.snap similarity index 90% rename from crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_where_name_nilike.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_where_name_nilike.snap index cf1faded8..692bd748c 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_where_name_nilike.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_where_name_nilike.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/explain_tests.rs +source: crates/tests/other-db-tests/src/citus/explain_tests.rs expression: result.details.query --- EXPLAIN diff --git a/crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_where_variable.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_where_variable.snap similarity index 90% rename from crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_where_variable.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_where_variable.snap index 09a565f7b..eb83e6efc 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/explain_tests__select_where_variable.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__explain__select_where_variable.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/explain_tests.rs +source: crates/tests/other-db-tests/src/citus/explain_tests.rs expression: result.details.query --- EXPLAIN diff --git a/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_by_pk.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_by_pk.snap new file mode 100644 index 000000000..8f1a541b2 --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_by_pk.snap @@ -0,0 +1,26 @@ +--- +source: crates/tests/other-db-tests/src/citus/explain_tests.rs +expression: result.details.query +--- +EXPLAIN +SELECT + row_to_json("%1_universe") AS "universe" +FROM + ( + SELECT + * + FROM + ( + SELECT + coalesce(json_agg(row_to_json("%2_rows")), '[]') AS "rows" + FROM + ( + SELECT + "%0_Album"."Title" AS "Title" + FROM + "public"."Album" AS "%0_Album" + WHERE + ("%0_Album"."AlbumId" = 35) + ) AS "%2_rows" + ) AS "%2_rows" + ) AS "%1_universe" diff --git a/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_where_name_nilike.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_where_name_nilike.snap new file mode 100644 index 000000000..692bd748c --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_where_name_nilike.snap @@ -0,0 +1,30 @@ +--- +source: crates/tests/other-db-tests/src/citus/explain_tests.rs +expression: result.details.query +--- +EXPLAIN +SELECT + row_to_json("%1_universe") AS "universe" +FROM + ( + SELECT + * + FROM + ( + SELECT + coalesce(json_agg(row_to_json("%2_rows")), '[]') AS "rows" + FROM + ( + SELECT + "%0_Album"."Title" AS "Title" + FROM + "public"."Album" AS "%0_Album" + WHERE + ("%0_Album"."Title" !~~* cast($1 as varchar)) + ORDER BY + "%0_Album"."AlbumId" ASC + LIMIT + 5 + ) AS "%2_rows" + ) AS "%2_rows" + ) AS "%1_universe" diff --git a/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_where_variable.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_where_variable.snap new file mode 100644 index 000000000..eb83e6efc --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__explain_tests__select_where_variable.snap @@ -0,0 +1,28 @@ +--- +source: crates/tests/other-db-tests/src/citus/explain_tests.rs +expression: result.details.query +--- +EXPLAIN +SELECT + row_to_json("%1_universe") AS "universe" +FROM + ( + SELECT + * + FROM + ( + SELECT + coalesce(json_agg(row_to_json("%2_rows")), '[]') AS "rows" + FROM + ( + SELECT + "%0_Album"."Title" AS "Title" + FROM + "public"."Album" AS "%0_Album" + WHERE + ("%0_Album"."Title" ~~ cast($1 as varchar)) + ORDER BY + "%0_Album"."AlbumId" ASC + ) AS "%2_rows" + ) AS "%2_rows" + ) AS "%1_universe" diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_albums.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_albums.snap similarity index 81% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_albums.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_albums.snap index 80b072417..517bd87b9 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_albums.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_albums.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_albums_plus_field.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_albums_plus_field.snap similarity index 89% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_albums_plus_field.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_albums_plus_field.snap index 662b90e08..b5e31bb39 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_albums_plus_field.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_albums_plus_field.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_artist_albums.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_artist_albums.snap similarity index 93% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_artist_albums.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_artist_albums.snap index e86cf3c23..aeeec5fe4 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_artist_albums.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_artist_albums.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_artist_albums_plus_field.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_artist_albums_plus_field.snap similarity index 96% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_artist_albums_plus_field.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_artist_albums_plus_field.snap index ed4b722a3..5f4f23183 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__aggregation__aggregate_count_artist_albums_plus_field.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__aggregation__aggregate_count_artist_albums_plus_field.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_5.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_5.snap similarity index 83% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_5.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_5.snap index 961aa2e9b..f4e75581a 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_5.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_5.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_by_pk.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_by_pk.snap similarity index 65% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_by_pk.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_by_pk.snap index 9d6b1577c..9b0e96e93 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_by_pk.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_by_pk.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_int_and_string.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_int_and_string.snap similarity index 69% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_int_and_string.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_int_and_string.snap index 6378ccfe5..c4081041e 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__basic__select_int_and_string.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__basic__select_int_and_string.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artist.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artist.snap similarity index 82% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artist.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artist.snap index 8aebafcc9..f5a641fbf 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artist.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artist.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artist_with_album_by_title_relationship_arguments.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artist_with_album_by_title_relationship_arguments.snap similarity index 94% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artist_with_album_by_title_relationship_arguments.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artist_with_album_by_title_relationship_arguments.snap index 57e029249..c1df1a671 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artist_with_album_by_title_relationship_arguments.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artist_with_album_by_title_relationship_arguments.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artists_below_id.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artists_below_id.snap similarity index 79% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artists_below_id.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artists_below_id.snap index 9a0d07acc..063a55164 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_artists_below_id.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_artists_below_id.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_order_by_artist_album_count.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_order_by_artist_album_count.snap similarity index 96% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_order_by_artist_album_count.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_order_by_artist_album_count.snap index 76f095e5b..0fbc107b3 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_order_by_artist_album_count.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_order_by_artist_album_count.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_sort_relationship.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_sort_relationship.snap similarity index 88% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_sort_relationship.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_sort_relationship.snap index 52658b736..b81565177 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_sort_relationship.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_sort_relationship.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_where_relationship.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_where_relationship.snap similarity index 86% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_where_relationship.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_where_relationship.snap index c16002a67..183886251 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__native_queries__select_where_relationship.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__native_queries__select_where_relationship.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_equals_self.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_equals_self.snap similarity index 72% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_equals_self.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_equals_self.snap index 98255d634..9a4e8815f 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_equals_self.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_equals_self.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_greater_than.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_greater_than.snap similarity index 92% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_greater_than.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_greater_than.snap index d9cbc9bdd..3fb56ac52 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_greater_than.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_greater_than.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_greater_than_or_equal_to.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_greater_than_or_equal_to.snap similarity index 93% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_greater_than_or_equal_to.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_greater_than_or_equal_to.snap index 74b42e089..667c8d6b4 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_greater_than_or_equal_to.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_greater_than_or_equal_to.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_is_not_null.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_is_not_null.snap similarity index 85% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_is_not_null.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_is_not_null.snap index a40d33153..c0da7d244 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_is_not_null.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_is_not_null.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_less_than.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_less_than.snap new file mode 100644 index 000000000..4ba372c92 --- /dev/null +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_less_than.snap @@ -0,0 +1,9 @@ +--- +source: crates/tests/other-db-tests/src/citus/query_tests.rs +expression: result +--- +[ + { + "rows": [] + } +] diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_less_than_or_equal_to.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_less_than_or_equal_to.snap similarity index 71% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_less_than_or_equal_to.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_less_than_or_equal_to.snap index 4e53e60c0..927eab5e2 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_album_id_less_than_or_equal_to.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_album_id_less_than_or_equal_to.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_and.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_and.snap similarity index 63% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_and.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_and.snap index a5e590463..259c43a94 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_and.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_and.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_array_relationship.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_array_relationship.snap similarity index 86% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_array_relationship.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_array_relationship.snap index 6cfa33492..0daa1f8e7 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_array_relationship.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_array_relationship.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_ilike.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_ilike.snap similarity index 91% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_ilike.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_ilike.snap index f2a95fcfe..20f3d7485 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_ilike.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_ilike.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_in.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_in.snap similarity index 69% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_in.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_in.snap index 53997355f..d540ca178 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_in.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_in.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_regex.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_iregex.snap similarity index 68% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_regex.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_iregex.snap index 0abde3a9e..6d6548d13 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_regex.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_iregex.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_like.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_like.snap similarity index 91% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_like.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_like.snap index f2a95fcfe..20f3d7485 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_like.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_like.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_nilike.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_nilike.snap similarity index 84% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_nilike.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_nilike.snap index 8f3512009..11e1553f7 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_nilike.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_nilike.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_niregex.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_niregex.snap similarity index 88% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_niregex.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_niregex.snap index 4b6514563..1a7cd211b 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_niregex.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_niregex.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_not_in.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_not_in.snap similarity index 88% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_not_in.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_not_in.snap index 4b6514563..1a7cd211b 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_not_in.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_not_in.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_not_like.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_not_like.snap similarity index 87% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_not_like.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_not_like.snap index 156dde627..77b33ad65 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_not_like.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_not_like.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_nregex.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_nregex.snap similarity index 93% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_nregex.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_nregex.snap index 712f3a7ea..ace70d9a3 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_nregex.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_nregex.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_iregex.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_regex.snap similarity index 68% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_iregex.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_regex.snap index 0abde3a9e..6d6548d13 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_name_iregex.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_name_regex.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_or.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_or.snap similarity index 70% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_or.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_or.snap index a8ac283a6..23b26855c 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_or.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_or.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_related_exists.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_related_exists.snap similarity index 86% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_related_exists.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_related_exists.snap index 6cfa33492..0daa1f8e7 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_related_exists.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_related_exists.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_unrelated_exists.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_unrelated_exists.snap similarity index 81% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_unrelated_exists.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_unrelated_exists.snap index 1f76ddb75..416d676cf 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_unrelated_exists.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_unrelated_exists.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_variable.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_variable.snap similarity index 80% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_variable.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_variable.snap index cd180ea68..2f981d18a 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_variable.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_variable.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_variable_int.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_variable_int.snap similarity index 81% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_variable_int.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_variable_int.snap index 434b3a49f..8bbde713a 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__predicates__select_where_variable_int.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__predicates__select_where_variable_int.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__dup_array_relationship.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__dup_array_relationship.snap similarity index 95% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__dup_array_relationship.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__dup_array_relationship.snap index 8a75262a1..f46b20d05 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__dup_array_relationship.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__dup_array_relationship.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__nested_array_relationships.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__nested_array_relationships.snap similarity index 97% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__nested_array_relationships.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__nested_array_relationships.snap index 79a53e0e1..d723224ba 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__nested_array_relationships.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__nested_array_relationships.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__nested_object_relationships.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__nested_object_relationships.snap similarity index 96% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__nested_object_relationships.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__nested_object_relationships.snap index cb4088772..b051d57ca 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__nested_object_relationships.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__nested_object_relationships.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__select_album_object_relationship_to_artist.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__select_album_object_relationship_to_artist.snap similarity index 93% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__select_album_object_relationship_to_artist.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__select_album_object_relationship_to_artist.snap index 23607fe97..b883a31ef 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__select_album_object_relationship_to_artist.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__select_album_object_relationship_to_artist.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__select_artist_array_relationship_to_album.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__select_artist_array_relationship_to_album.snap similarity index 95% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__select_artist_array_relationship_to_album.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__select_artist_array_relationship_to_album.snap index 7afc93fb4..885dc96c7 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__select_artist_array_relationship_to_album.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__select_artist_array_relationship_to_album.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__very_nested_recursive_relationship.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__very_nested_recursive_relationship.snap similarity index 98% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__very_nested_recursive_relationship.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__very_nested_recursive_relationship.snap index 19494cf07..654cccc75 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__relationships__very_nested_recursive_relationship.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__relationships__very_nested_recursive_relationship.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_album_artist_name.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_album_artist_name.snap similarity index 86% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_album_artist_name.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_album_artist_name.snap index b39818759..0aec065de 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_album_artist_name.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_album_artist_name.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_album_count.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_album_count.snap similarity index 76% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_album_count.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_album_count.snap index 12530da00..87f31a3a0 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_album_count.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_album_count.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_album_count_agg.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_album_count_agg.snap similarity index 76% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_album_count_agg.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_album_count_agg.snap index 12530da00..87f31a3a0 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_album_count_agg.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_album_count_agg.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_name.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_name.snap similarity index 86% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_name.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_name.snap index 95081bb9c..95f658032 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_name.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_name.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_name_with_name.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_name_with_name.snap similarity index 95% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_name_with_name.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_name_with_name.snap index 05b7ddfcd..5150bbd53 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_artist_name_with_name.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_artist_name_with_name.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_name.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_name.snap similarity index 84% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_name.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_name.snap index 05a819ef2..9fb279bb6 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_order_by_name.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_order_by_name.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_track_order_by_artist_id_and_album_title.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_track_order_by_artist_id_and_album_title.snap similarity index 84% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_track_order_by_artist_id_and_album_title.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_track_order_by_artist_id_and_album_title.snap index 8c7f2b65c..814fcafe4 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__select_track_order_by_artist_id_and_album_title.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__select_track_order_by_artist_id_and_album_title.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_nested_relationship_column_with_predicate.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_nested_relationship_column_with_predicate.snap similarity index 71% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_nested_relationship_column_with_predicate.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_nested_relationship_column_with_predicate.snap index 0a113b57e..669d8544a 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_nested_relationship_column_with_predicate.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_nested_relationship_column_with_predicate.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_nested_relationship_column_with_predicate_exists.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_nested_relationship_column_with_predicate_exists.snap similarity index 83% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_nested_relationship_column_with_predicate_exists.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_nested_relationship_column_with_predicate_exists.snap index 0e5261d09..a870e4efd 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_nested_relationship_column_with_predicate_exists.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_nested_relationship_column_with_predicate_exists.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_relationship_count_with_predicate.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_relationship_count_with_predicate.snap similarity index 82% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_relationship_count_with_predicate.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_relationship_count_with_predicate.snap index 4a13a1523..8650ece80 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__sorting__sorting_by_relationship_count_with_predicate.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__sorting__sorting_by_relationship_count_with_predicate.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/query_tests__types__select_value_types.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__types__select_value_types.snap similarity index 90% rename from crates/connectors/ndc-citus/tests/snapshots/query_tests__types__select_value_types.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__types__select_value_types.snap index f67bdb14f..1a98e8849 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/query_tests__types__select_value_types.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__query_tests__types__select_value_types.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/query_tests.rs +source: crates/tests/other-db-tests/src/citus/query_tests.rs expression: result --- [ diff --git a/crates/connectors/ndc-citus/tests/snapshots/schema_tests__get_schema.snap b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__schema_tests__schema_test__get_schema.snap similarity index 99% rename from crates/connectors/ndc-citus/tests/snapshots/schema_tests__get_schema.snap rename to crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__schema_tests__schema_test__get_schema.snap index 20b8971af..6ae83157d 100644 --- a/crates/connectors/ndc-citus/tests/snapshots/schema_tests__get_schema.snap +++ b/crates/tests/other-db-tests/src/citus/snapshots/other_db_tests__citus__schema_tests__schema_test__get_schema.snap @@ -1,5 +1,5 @@ --- -source: crates/connectors/ndc-citus/tests/schema_tests.rs +source: crates/tests/other-db-tests/src/citus/schema_tests.rs expression: result --- { diff --git a/crates/tests/other-db-tests/src/lib.rs b/crates/tests/other-db-tests/src/lib.rs index 565d7a394..fe24a1637 100644 --- a/crates/tests/other-db-tests/src/lib.rs +++ b/crates/tests/other-db-tests/src/lib.rs @@ -3,3 +3,9 @@ pub mod aurora; #[cfg(feature = "yugabyte")] pub mod yugabyte; + +// #[cfg(feature = "cockroach")] +// pub mod cockroach; + +#[cfg(feature = "citus")] +pub mod citus; diff --git a/crates/tests/tests-common/Cargo.toml b/crates/tests/tests-common/Cargo.toml index 6704fbdfa..43c255bc0 100644 --- a/crates/tests/tests-common/Cargo.toml +++ b/crates/tests/tests-common/Cargo.toml @@ -9,16 +9,23 @@ name = "tests_common" path = "src/lib.rs" [dependencies] +ndc-client = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.8" } +ndc-postgres = { path = "../../connectors/ndc-postgres" } ndc-sdk = { git = "https://github.com/hasura/ndc-hub.git", rev = "098b1c2", package = "ndc-sdk" } +ndc-test = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.0-rc.8" } axum = "0.6.19" axum-test-helper = "0.3.0" +hyper = { version = "0.14.27", features = ["tcp"] } jsonschema = { version = "0.17.1", default-features = false, features = ["resolve-http"] } -serde = "1.0.189" +reqwest = "0.11.22" schemars = { version = "0.8.15", features = ["smol_str", "preserve_order"] } +serde = "1.0.189" serde_derive = "^1.0" serde_json = { version = "1.0.107", features = ["raw_value"] } +similar-asserts = "1.5.0" sqlx = { version = "0.7.2", features = [ "json", "postgres", "runtime-tokio-rustls" ] } +tokio = { version = "1.33.0", features = ["full"] } tokio-postgres = "0.7.10" tracing = "0.1.40" uuid = {version = "1.5.0", features = [ "v4", "fast-rng", "macro-diagnostics" ]} diff --git a/crates/connectors/ndc-citus/tests/configuration_tests.rs b/crates/tests/tests-common/src/common_tests/configuration_tests.rs similarity index 50% rename from crates/connectors/ndc-citus/tests/configuration_tests.rs rename to crates/tests/tests-common/src/common_tests/configuration_tests.rs index 962506bd7..3a12b7474 100644 --- a/crates/connectors/ndc-citus/tests/configuration_tests.rs +++ b/crates/tests/tests-common/src/common_tests/configuration_tests.rs @@ -1,29 +1,20 @@ -//! Tests that configuration generation has not changed. -//! -//! If you have changed it intentionally, run `just generate-chinook-configuration`. - -pub mod common; - -use std::fs; - -use similar_asserts::assert_eq; - +use crate::deployment::helpers::get_path_from_project_root; +use crate::schemas::check_value_conforms_to_schema; use ndc_postgres::configuration; +use similar_asserts::assert_eq; +use std::fs; -use tests_common::deployment::helpers::get_path_from_project_root; -use tests_common::schemas::check_value_conforms_to_schema; - -const CONFIGURATION_QUERY: &str = include_str!("../../ndc-postgres/src/configuration.sql"); +const CONFIGURATION_QUERY: &str = + include_str!("../../../../connectors/ndc-postgres/src/configuration.sql"); -#[tokio::test] -async fn test_configure() { - let expected_value = read_configuration(); +pub async fn test_configure(connection_string: &str, chinook_deployment_path: &str) { + let expected_value = read_configuration(chinook_deployment_path); let mut args: configuration::RawConfiguration = serde_json::from_value(expected_value.clone()) .expect("Unable to deserialize as RawConfiguration"); args.connection_uri = configuration::ConnectionUri::Uri(configuration::ResolvedSecret( - common::POSTGRESQL_CONNECTION_STRING.to_string(), + connection_string.to_string(), )); let actual = configuration::configure(args, CONFIGURATION_QUERY) @@ -35,13 +26,14 @@ async fn test_configure() { assert_eq!(expected_value, actual_value); } -#[test] -fn configuration_conforms_to_the_schema() { - check_value_conforms_to_schema::(read_configuration()); +pub fn configuration_conforms_to_the_schema(chinook_deployment_path: &str) { + check_value_conforms_to_schema::(read_configuration( + chinook_deployment_path, + )); } -fn read_configuration() -> serde_json::Value { - let file = fs::File::open(get_path_from_project_root(common::CHINOOK_DEPLOYMENT_PATH)) +fn read_configuration(chinook_deployment_path: &str) -> serde_json::Value { + let file = fs::File::open(get_path_from_project_root(chinook_deployment_path)) .expect("fs::File::open"); serde_json::from_reader(file).expect("serde_json::from_reader") } diff --git a/crates/tests/tests-common/src/common_tests/mod.rs b/crates/tests/tests-common/src/common_tests/mod.rs new file mode 100644 index 000000000..1471e000e --- /dev/null +++ b/crates/tests/tests-common/src/common_tests/mod.rs @@ -0,0 +1,2 @@ +pub mod configuration_tests; +pub mod ndc_tests; diff --git a/crates/connectors/ndc-citus/tests/ndc_tests.rs b/crates/tests/tests-common/src/common_tests/ndc_tests.rs similarity index 84% rename from crates/connectors/ndc-citus/tests/ndc_tests.rs rename to crates/tests/tests-common/src/common_tests/ndc_tests.rs index 9af7009e7..67c234312 100644 --- a/crates/connectors/ndc-citus/tests/ndc_tests.rs +++ b/crates/tests/tests-common/src/common_tests/ndc_tests.rs @@ -1,12 +1,6 @@ -//! Runs the tests provided by the ndc-spec. - -pub mod common; - use std::net; -#[tokio::test] -async fn test_connector() -> Result<(), Vec> { - let router = common::create_router().await; +pub async fn test_connector(router: axum::Router) -> Result<(), Vec> { let server = hyper::Server::bind(&net::SocketAddr::new( net::IpAddr::V4(net::Ipv4Addr::LOCALHOST), 0, diff --git a/crates/tests/tests-common/src/lib.rs b/crates/tests/tests-common/src/lib.rs index 7d1c2bd74..61e8d1a63 100644 --- a/crates/tests/tests-common/src/lib.rs +++ b/crates/tests/tests-common/src/lib.rs @@ -1,6 +1,7 @@ //! Test helpers for testing connectors. pub mod assert; +pub mod common_tests; pub mod deployment; pub mod request; pub mod schemas; diff --git a/flake.nix b/flake.nix index 67a9da45e..ad7183491 100644 --- a/flake.nix +++ b/flake.nix @@ -90,7 +90,6 @@ postgres-binaries = make-binaries "ndc-postgres"; cockroach-binaries = make-binaries "ndc-cockroach"; - citus-binaries = make-binaries "ndc-citus"; inherit (postgres-binaries.local-system) cargoArtifacts rustToolchain craneLib buildArgs; @@ -99,7 +98,6 @@ packages = builtins.foldl' (x: y: x // y) { } [ (make-packages postgres-binaries) (make-packages cockroach-binaries) - (make-packages citus-binaries) ] // { default = postgres-binaries.local-system; diff --git a/justfile b/justfile index 8c4894a7a..f330766c1 100644 --- a/justfile +++ b/justfile @@ -110,7 +110,7 @@ dev-cockroach: start-dependencies -c \ -x 'test -p query-engine-translation -p ndc-cockroach' \ -x clippy \ - -x 'run --bin ndc-cockroach -- serve --configuration {{COCKROACH_CHINOOK_DEPLOYMENT}}' + -x 'run --bin ndc-postgres -- serve --configuration {{COCKROACH_CHINOOK_DEPLOYMENT}}' # watch the code, then test and re-run on changes dev-citus: start-dependencies @@ -119,9 +119,9 @@ dev-citus: start-dependencies OTEL_SERVICE_NAME=citus-ndc \ cargo watch -i "**/snapshots/*" \ -c \ - -x 'test -p query-engine-translation -p ndc-citus' \ + -x 'test -p query-engine-translation -p other-db-tests --features citus' \ -x clippy \ - -x 'run --bin ndc-citus -- serve --configuration {{CITUS_CHINOOK_DEPLOYMENT}}' + -x 'run --bin ndc-postgres -- serve --configuration {{CITUS_CHINOOK_DEPLOYMENT}}' # Generate the JSON Schema document for Configuration V1. document-jsonschema: @@ -197,6 +197,9 @@ test *args: start-dependencies create-aurora-deployment echo "$(tput bold)$(tput setaf 3)WARNING:$(tput sgr0) Skipping the Yugabyte tests because we are running on a non-x86_64 architecture." fi + # run citus tests + TEST_COMMAND+=(--features citus) + TEST_COMMAND+=({{ args }}) echo "$(tput bold)${TEST_COMMAND[*]}$(tput sgr0)" @@ -205,7 +208,7 @@ test *args: start-dependencies create-aurora-deployment # re-generate the deployment configuration file generate-chinook-configuration: build start-dependencies ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{POSTGRESQL_CONNECTION_STRING}}' '{{POSTGRES_CHINOOK_DEPLOYMENT}}' - ./scripts/generate-chinook-configuration.sh 'ndc-citus' '{{CITUS_CONNECTION_STRING}}' '{{CITUS_CHINOOK_DEPLOYMENT}}' + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{CITUS_CONNECTION_STRING}}' '{{CITUS_CHINOOK_DEPLOYMENT}}' ./scripts/generate-chinook-configuration.sh 'ndc-cockroach' '{{COCKROACH_CONNECTION_STRING}}' '{{COCKROACH_CHINOOK_DEPLOYMENT}}' ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{YUGABYTE_CONNECTION_STRING}}' '{{YUGABYTE_CHINOOK_DEPLOYMENT}}' @ if [[ -n '{{AURORA_CONNECTION_STRING}}' ]]; then \ @@ -299,7 +302,7 @@ find-unused-dependencies: # check the nix builds work build-with-nix: - nix build --no-warn-dirty --print-build-logs '.#ndc-postgres' '.#ndc-cockroach' '.#ndc-citus' + nix build --no-warn-dirty --print-build-logs '.#ndc-postgres' '.#ndc-cockroach' # run ndc-postgres-multitenant whilst outputting profile data for massif massif-postgres: start-dependencies