diff --git a/Cargo.lock b/Cargo.lock index 17b7f48..0acac35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -352,12 +352,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" -[[package]] -name = "colorful" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97af0562545a7d7f3d9222fcf909963bec36dcb502afaacab98c6ffac8da47ce" - [[package]] name = "common" version = "1.0.5" @@ -1079,16 +1073,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1146,38 +1130,48 @@ dependencies = [ name = "ndc-clickhouse" version = "1.0.5" dependencies = [ - "async-trait", - "bytes", + "ndc-clickhouse-core", + "ndc-sdk", + "tokio", +] + +[[package]] +name = "ndc-clickhouse-cli" +version = "1.0.5" +dependencies = [ + "clap", "common", - "http 0.2.12", - "indexmap 2.5.0", "insta", - "ndc-sdk", - "prometheus", + "ndc-clickhouse-core", + "ndc-models", + "ndc-sdk-core", "reqwest 0.12.7", "schemars", "serde", "serde_json", - "sqlformat", - "strum", - "thiserror", "tokio", - "tracing", ] [[package]] -name = "ndc-clickhouse-cli" +name = "ndc-clickhouse-core" version = "1.0.5" dependencies = [ - "clap", + "async-trait", "common", + "http 0.2.12", + "indexmap 2.5.0", "insta", "ndc-models", + "ndc-sdk-core", + "prometheus", "reqwest 0.12.7", "schemars", "serde", "serde_json", + "sqlformat", + "thiserror", "tokio", + "tracing", ] [[package]] @@ -1196,18 +1190,16 @@ dependencies = [ [[package]] name = "ndc-sdk" -version = "0.4.0" -source = "git+https://github.com/hasura/ndc-sdk-rs?tag=v0.4.0#665509f7d3b47ce4f014fc23f817a3599ba13933" +version = "0.5.0" +source = "git+https://github.com/hasura/ndc-sdk-rs?tag=v0.5.0#15840777b3700112a508bb116f1131804e800c13" dependencies = [ "async-trait", "axum", "axum-extra", - "bytes", "clap", "http 0.2.12", - "mime", "ndc-models", - "ndc-test", + "ndc-sdk-core", "opentelemetry", "opentelemetry-http", "opentelemetry-otlp", @@ -1216,7 +1208,6 @@ dependencies = [ "opentelemetry_sdk", "prometheus", "reqwest 0.11.27", - "serde", "serde_json", "thiserror", "tokio", @@ -1228,24 +1219,22 @@ dependencies = [ ] [[package]] -name = "ndc-test" -version = "0.1.6" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.6#d1be19e9cdd86ac7b6ad003ff82b7e5b4e96b84f" +name = "ndc-sdk-core" +version = "0.5.0" +source = "git+https://github.com/hasura/ndc-sdk-rs?tag=v0.5.0#15840777b3700112a508bb116f1131804e800c13" dependencies = [ "async-trait", - "clap", - "colorful", - "indexmap 2.5.0", + "axum", + "bytes", + "http 0.2.12", + "mime", "ndc-models", - "rand", - "reqwest 0.11.27", - "semver", + "prometheus", "serde", "serde_json", - "smol_str", "thiserror", "tokio", - "url", + "tracing", ] [[package]] @@ -1809,11 +1798,11 @@ dependencies = [ "js-sys", "log", "mime", - "mime_guess", "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -1912,6 +1901,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + [[package]] name = "rustls" version = "0.22.4" @@ -1921,7 +1922,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -1935,7 +1936,7 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -1978,6 +1979,16 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustls-webpki" version = "0.102.7" @@ -2052,6 +2063,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -2075,12 +2096,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - [[package]] name = "serde" version = "1.0.209" @@ -2437,7 +2452,6 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -2723,15 +2737,6 @@ dependencies = [ "syn", ] -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -2800,12 +2805,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "walkdir" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index 258e3f9..c04a977 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "crates/ndc-clickhouse", "crates/ndc-clickhouse-cli", + "crates/ndc-clickhouse-core", "crates/common", ] resolver = "2" @@ -9,6 +10,13 @@ resolver = "2" package.version = "1.0.5" package.edition = "2021" +[workspace.dependencies] +ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.6" } +ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs", tag = "v0.5.0", package = "ndc-sdk", features = [ + "rustls", +], default-features = false } +ndc-sdk-core = { git = "https://github.com/hasura/ndc-sdk-rs", tag = "v0.5.0", package = "ndc-sdk-core", default-features = false } + # insta performs better in release mode [profile.dev.package] insta.opt-level = 3 diff --git a/crates/common/src/config.rs b/crates/common/src/config.rs index ca21be3..b2cd417 100644 --- a/crates/common/src/config.rs +++ b/crates/common/src/config.rs @@ -143,10 +143,10 @@ pub fn get_connection_configuration( } pub async fn read_server_config( - configuration_dir: impl AsRef + Send, + configuration_dir: &Path, environment: &ConfigurationEnvironment, ) -> Result { - let file_path = configuration_dir.as_ref().join(CONFIG_FILE_NAME); + let file_path = configuration_dir.join(CONFIG_FILE_NAME); let connection = get_connection_configuration(environment)?; @@ -259,7 +259,7 @@ pub async fn read_server_config( let mut queries = BTreeMap::new(); for (query_alias, query_config) in config.queries.clone() { - let query_file_path = configuration_dir.as_ref().join(&query_config.file); + let query_file_path = configuration_dir.join(&query_config.file); let file_content = fs::read_to_string(&query_file_path) .await diff --git a/crates/ndc-clickhouse-cli/Cargo.toml b/crates/ndc-clickhouse-cli/Cargo.toml index e5ad093..25c5424 100644 --- a/crates/ndc-clickhouse-cli/Cargo.toml +++ b/crates/ndc-clickhouse-cli/Cargo.toml @@ -6,7 +6,9 @@ edition.workspace = true [dependencies] clap = { version = "4.5.3", features = ["derive", "env"] } common = { path = "../common" } -ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.6" } +ndc-models = { workspace = true } +ndc-sdk-core = { workspace = true } +ndc-clickhouse-core = { path = "../ndc-clickhouse-core" } reqwest = { version = "0.12.3", features = [ "json", "rustls-tls", diff --git a/crates/ndc-clickhouse-cli/src/main.rs b/crates/ndc-clickhouse-cli/src/main.rs index 09694df..0245510 100644 --- a/crates/ndc-clickhouse-cli/src/main.rs +++ b/crates/ndc-clickhouse-cli/src/main.rs @@ -1,29 +1,28 @@ -use std::{ - collections::{BTreeMap, HashMap}, - env, - error::Error, - path::{Path, PathBuf}, - str::FromStr, -}; - use clap::{Parser, Subcommand, ValueEnum}; use common::{ - capabilities::capabilities_response, clickhouse_parser::{ datatype::ClickHouseDataType, parameterized_query::{Parameter, ParameterizedQuery, ParameterizedQueryElement}, }, - config::{read_server_config, ConfigurationEnvironment, ConnectionConfig}, + config::ConnectionConfig, config_file::{ ParameterizedQueryConfigFile, PrimaryKey, ReturnType, ServerConfigFile, TableConfigFile, CONFIG_FILE_NAME, CONFIG_SCHEMA_FILE_NAME, }, - schema::schema_response, }; use database_introspection::{introspect_database, TableInfo}; -use ndc_models::{CapabilitiesResponse, CollectionName, FieldName, SchemaResponse}; +use ndc_clickhouse_core::connector::setup::ClickhouseConnectorSetup; +use ndc_models::{CollectionName, FieldName}; +use ndc_sdk_core::schema::print_schema_and_capabilities; use schemars::schema_for; -use serde::Serialize; +use std::{ + collections::{BTreeMap, HashMap}, + env, + error::Error, + io, + path::{Path, PathBuf}, + str::FromStr, +}; use tokio::fs; mod database_introspection; @@ -85,7 +84,18 @@ enum Command { }, Validate {}, Watch {}, - PrintSchemaAndCapabilities {}, + PrintSchemaAndCapabilities { + #[arg(long = "clickhouse-url", value_name = "URL", env = "CLICKHOUSE_URL")] + url: String, + #[arg(long = "clickhouse-username", value_name = "USERNAME", env = "CLICKHOUSE_USERNAME", default_value_t = String::from("default"))] + username: String, + #[arg( + long = "clickhouse-password", + value_name = "PASSWORD", + env = "CLICKHOUSE_PASSWORD" + )] + password: String, + }, UpgradeConfiguration {}, } @@ -100,12 +110,6 @@ enum LogLevel { Trace, } -#[derive(Serialize)] -struct SchemaAndCapabilities { - schema: SchemaResponse, - capabilities: CapabilitiesResponse, -} - #[tokio::main] async fn main() -> Result<(), Box> { let args = CliArgs::parse(); @@ -155,28 +159,21 @@ async fn main() -> Result<(), Box> { Command::Watch {} => { todo!("implement watch command") } - Command::PrintSchemaAndCapabilities {} => { - // set mock values for required env vars, we won't be reading these anyways + Command::PrintSchemaAndCapabilities { + url, + username, + password, + } => { + // use simulated environment so env vars can be read from command line arguments let env = HashMap::from_iter(vec![ - ("CLICKHOUSE_URL".to_owned(), "".to_owned()), - ("CLICKHOUSE_USERNAME".to_owned(), "".to_owned()), - ("CLICKHOUSE_PASSWORD".to_owned(), "".to_owned()), + ("CLICKHOUSE_URL".to_owned(), url), + ("CLICKHOUSE_USERNAME".to_owned(), username), + ("CLICKHOUSE_PASSWORD".to_owned(), password), ]); - let configuration = read_server_config( - context_path, - &ConfigurationEnvironment::from_simulated_environment(env), - ) - .await?; + let setup = ClickhouseConnectorSetup::new_from_env(env); - let schema_and_capabilities = SchemaAndCapabilities { - schema: schema_response(&configuration), - capabilities: capabilities_response(), - }; - println!( - "{}", - serde_json::to_string(&schema_and_capabilities) - .expect("Schema and capabilities should serialize to JSON") - ) + let mut stdout = io::stdout().lock(); + print_schema_and_capabilities(setup, &context_path, &mut stdout).await?; } Command::UpgradeConfiguration {} => { println!("Upgrade Configuration command is currently a NOOP") diff --git a/crates/ndc-clickhouse-core/Cargo.toml b/crates/ndc-clickhouse-core/Cargo.toml new file mode 100644 index 0000000..5593c90 --- /dev/null +++ b/crates/ndc-clickhouse-core/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "ndc-clickhouse-core" +version.workspace = true +edition.workspace = true + +[dependencies] +async-trait = "0.1.78" +common = { path = "../common" } +http = "0.2" +indexmap = "2.1.0" +ndc-models = { workspace = true } +ndc-sdk-core = { workspace = true } +prometheus = "0.13.3" +reqwest = { version = "0.12.3", features = [ + "json", + "rustls-tls", +], default-features = false } +schemars = "0.8.16" +serde = { version = "1.0.197", features = ["derive"] } +serde_json = "1.0.114" +sqlformat = "0.2.3" +thiserror = "1.0.64" +tokio = "1.36.0" +tracing = "0.1.40" + +[dev-dependencies] +insta = { version = "1.40.0", features = ["yaml", "glob", "json"] } +schemars = "0.8.16" diff --git a/crates/ndc-clickhouse/src/connector.rs b/crates/ndc-clickhouse-core/src/connector.rs similarity index 97% rename from crates/ndc-clickhouse/src/connector.rs rename to crates/ndc-clickhouse-core/src/connector.rs index 0b5fcdb..4efed05 100644 --- a/crates/ndc-clickhouse/src/connector.rs +++ b/crates/ndc-clickhouse-core/src/connector.rs @@ -6,10 +6,10 @@ use self::state::ServerState; use async_trait::async_trait; use common::{capabilities::capabilities, config::ServerConfig, schema::schema_response}; use http::StatusCode; -use ndc_sdk::{ +use ndc_models as models; +use ndc_sdk_core::{ connector::{Connector, ErrorResponse, Result}, json_response::JsonResponse, - models, }; #[derive(Debug, Clone, Default)] diff --git a/crates/ndc-clickhouse/src/connector/handler.rs b/crates/ndc-clickhouse-core/src/connector/handler.rs similarity index 100% rename from crates/ndc-clickhouse/src/connector/handler.rs rename to crates/ndc-clickhouse-core/src/connector/handler.rs diff --git a/crates/ndc-clickhouse/src/connector/handler/explain.rs b/crates/ndc-clickhouse-core/src/connector/handler/explain.rs similarity index 96% rename from crates/ndc-clickhouse/src/connector/handler/explain.rs rename to crates/ndc-clickhouse-core/src/connector/handler/explain.rs index 4abc479..c39c3e2 100644 --- a/crates/ndc-clickhouse/src/connector/handler/explain.rs +++ b/crates/ndc-clickhouse-core/src/connector/handler/explain.rs @@ -1,8 +1,8 @@ -use std::collections::BTreeMap; - use common::{client::execute_json_query, config::ServerConfig}; -use ndc_sdk::{connector::ErrorResponse, json_response::JsonResponse, models}; +use ndc_models as models; +use ndc_sdk_core::{connector::ErrorResponse, json_response::JsonResponse}; use serde::{Deserialize, Serialize}; +use std::collections::BTreeMap; use crate::{connector::state::ServerState, sql::QueryBuilder}; diff --git a/crates/ndc-clickhouse/src/connector/handler/query.rs b/crates/ndc-clickhouse-core/src/connector/handler/query.rs similarity index 91% rename from crates/ndc-clickhouse/src/connector/handler/query.rs rename to crates/ndc-clickhouse-core/src/connector/handler/query.rs index 7cdb9b1..d34ce04 100644 --- a/crates/ndc-clickhouse/src/connector/handler/query.rs +++ b/crates/ndc-clickhouse-core/src/connector/handler/query.rs @@ -1,6 +1,7 @@ use common::{client::execute_query, config::ServerConfig}; -use ndc_sdk::{connector::ErrorResponse, json_response::JsonResponse, models}; -use tracing::{Instrument, Level}; +use ndc_models as models; +use ndc_sdk_core::{connector::ErrorResponse, json_response::JsonResponse}; +use tracing::Instrument; use crate::{connector::state::ServerState, sql::QueryBuilder}; @@ -11,6 +12,7 @@ pub async fn query( ) -> Result, ErrorResponse> { #[cfg(debug_assertions)] { + use tracing::Level; // this block only present in debug builds, to avoid leaking sensitive information let request_string = serde_json::to_string(&request).map_err(ErrorResponse::from_error)?; @@ -25,6 +27,7 @@ pub async fn query( #[cfg(debug_assertions)] { + use tracing::Level; // this block only present in debug builds, to avoid leaking sensitive information let unsafe_statement_string = QueryBuilder::new(&request, configuration) .build_inlined()? @@ -64,6 +67,7 @@ pub async fn query( #[cfg(debug_assertions)] { + use tracing::Level; // this block only present in debug builds, to avoid leaking sensitive information let result_string = std::str::from_utf8(&rowsets).map_err(ErrorResponse::from_error)?; diff --git a/crates/ndc-clickhouse/src/connector/setup.rs b/crates/ndc-clickhouse-core/src/connector/setup.rs similarity index 91% rename from crates/ndc-clickhouse/src/connector/setup.rs rename to crates/ndc-clickhouse-core/src/connector/setup.rs index aaad914..7245148 100644 --- a/crates/ndc-clickhouse/src/connector/setup.rs +++ b/crates/ndc-clickhouse-core/src/connector/setup.rs @@ -1,7 +1,7 @@ use super::{state::ServerState, ClickhouseConnector}; use async_trait::async_trait; use common::config::{read_server_config, ConfigurationEnvironment}; -use ndc_sdk::connector::{self, Connector, ConnectorSetup, ErrorResponse}; +use ndc_sdk_core::connector::{self, Connector, ConnectorSetup, ErrorResponse}; use std::{collections::HashMap, path::Path}; #[derive(Debug, Clone)] pub struct ClickhouseConnectorSetup(ConfigurationEnvironment); @@ -12,7 +12,7 @@ impl ConnectorSetup for ClickhouseConnectorSetup { async fn parse_configuration( &self, - configuration_dir: impl AsRef + Send, + configuration_dir: &Path, ) -> connector::Result<::Configuration> { // we wrap read_server_config so the ParseError is implicitly converted into an ErrorResponse read_server_config(configuration_dir, &self.0) diff --git a/crates/ndc-clickhouse/src/connector/state.rs b/crates/ndc-clickhouse-core/src/connector/state.rs similarity index 100% rename from crates/ndc-clickhouse/src/connector/state.rs rename to crates/ndc-clickhouse-core/src/connector/state.rs diff --git a/crates/ndc-clickhouse/src/lib.rs b/crates/ndc-clickhouse-core/src/lib.rs similarity index 100% rename from crates/ndc-clickhouse/src/lib.rs rename to crates/ndc-clickhouse-core/src/lib.rs diff --git a/crates/ndc-clickhouse/src/sql.rs b/crates/ndc-clickhouse-core/src/sql.rs similarity index 100% rename from crates/ndc-clickhouse/src/sql.rs rename to crates/ndc-clickhouse-core/src/sql.rs diff --git a/crates/ndc-clickhouse/src/sql/ast.rs b/crates/ndc-clickhouse-core/src/sql/ast.rs similarity index 100% rename from crates/ndc-clickhouse/src/sql/ast.rs rename to crates/ndc-clickhouse-core/src/sql/ast.rs diff --git a/crates/ndc-clickhouse/src/sql/ast/format.rs b/crates/ndc-clickhouse-core/src/sql/ast/format.rs similarity index 100% rename from crates/ndc-clickhouse/src/sql/ast/format.rs rename to crates/ndc-clickhouse-core/src/sql/ast/format.rs diff --git a/crates/ndc-clickhouse/src/sql/query_builder.rs b/crates/ndc-clickhouse-core/src/sql/query_builder.rs similarity index 99% rename from crates/ndc-clickhouse/src/sql/query_builder.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder.rs index 9391b2f..30a9938 100644 --- a/crates/ndc-clickhouse/src/sql/query_builder.rs +++ b/crates/ndc-clickhouse-core/src/sql/query_builder.rs @@ -23,8 +23,8 @@ use comparison_column::ComparisonColumn; pub use error::QueryBuilderError; use function_expression::apply_function; use indexmap::IndexMap; -use ndc_sdk::models::{ - self, AggregateFunctionName, ArgumentName, CollectionName, FieldName, ObjectTypeName, +use ndc_models::{ + self as models, AggregateFunctionName, ArgumentName, CollectionName, FieldName, ObjectTypeName, RelationshipName, VariableName, }; use parameter::ParameterBuilder; diff --git a/crates/ndc-clickhouse/src/sql/query_builder/binary_comparison_expression.rs b/crates/ndc-clickhouse-core/src/sql/query_builder/binary_comparison_expression.rs similarity index 100% rename from crates/ndc-clickhouse/src/sql/query_builder/binary_comparison_expression.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder/binary_comparison_expression.rs diff --git a/crates/ndc-clickhouse/src/sql/query_builder/collection_context.rs b/crates/ndc-clickhouse-core/src/sql/query_builder/collection_context.rs similarity index 96% rename from crates/ndc-clickhouse/src/sql/query_builder/collection_context.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder/collection_context.rs index e3b9a13..2e776b4 100644 --- a/crates/ndc-clickhouse/src/sql/query_builder/collection_context.rs +++ b/crates/ndc-clickhouse-core/src/sql/query_builder/collection_context.rs @@ -1,6 +1,6 @@ use std::collections::BTreeMap; -use ndc_sdk::models::{Argument, ArgumentName, CollectionName, Relationship, RelationshipArgument}; +use ndc_models::{Argument, ArgumentName, CollectionName, Relationship, RelationshipArgument}; #[derive(Debug, Clone)] pub enum CollectionContext<'a, 'b> { diff --git a/crates/ndc-clickhouse/src/sql/query_builder/comparison_column.rs b/crates/ndc-clickhouse-core/src/sql/query_builder/comparison_column.rs similarity index 100% rename from crates/ndc-clickhouse/src/sql/query_builder/comparison_column.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder/comparison_column.rs diff --git a/crates/ndc-clickhouse/src/sql/query_builder/error.rs b/crates/ndc-clickhouse-core/src/sql/query_builder/error.rs similarity index 96% rename from crates/ndc-clickhouse/src/sql/query_builder/error.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder/error.rs index e825d77..1a2042a 100644 --- a/crates/ndc-clickhouse/src/sql/query_builder/error.rs +++ b/crates/ndc-clickhouse-core/src/sql/query_builder/error.rs @@ -1,13 +1,11 @@ use super::typecasting::TypeStringError; use common::clickhouse_parser::{datatype::ClickHouseDataType, parameterized_query::ParameterType}; use http::StatusCode; -use ndc_sdk::{ - connector::ErrorResponse, - models::{ - AggregateFunctionName, ArgumentName, CollectionName, ComparisonOperatorName, FieldName, - ObjectTypeName, RelationshipName, - }, +use ndc_models::{ + AggregateFunctionName, ArgumentName, CollectionName, ComparisonOperatorName, FieldName, + ObjectTypeName, RelationshipName, }; +use ndc_sdk_core::connector::ErrorResponse; #[derive(Debug, PartialEq, thiserror::Error)] pub enum QueryBuilderError { diff --git a/crates/ndc-clickhouse/src/sql/query_builder/function_expression.rs b/crates/ndc-clickhouse-core/src/sql/query_builder/function_expression.rs similarity index 100% rename from crates/ndc-clickhouse/src/sql/query_builder/function_expression.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder/function_expression.rs diff --git a/crates/ndc-clickhouse/src/sql/query_builder/parameter.rs b/crates/ndc-clickhouse-core/src/sql/query_builder/parameter.rs similarity index 100% rename from crates/ndc-clickhouse/src/sql/query_builder/parameter.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder/parameter.rs diff --git a/crates/ndc-clickhouse/src/sql/query_builder/typecasting.rs b/crates/ndc-clickhouse-core/src/sql/query_builder/typecasting.rs similarity index 99% rename from crates/ndc-clickhouse/src/sql/query_builder/typecasting.rs rename to crates/ndc-clickhouse-core/src/sql/query_builder/typecasting.rs index 87c5922..51351e5 100644 --- a/crates/ndc-clickhouse/src/sql/query_builder/typecasting.rs +++ b/crates/ndc-clickhouse-core/src/sql/query_builder/typecasting.rs @@ -7,8 +7,8 @@ use common::{ }, }; use indexmap::IndexMap; -use ndc_sdk::models::{ - self, AggregateFunctionName, CollectionName, FieldName, NestedField, ObjectTypeName, +use ndc_models::{ + self as models, AggregateFunctionName, CollectionName, FieldName, NestedField, ObjectTypeName, RelationshipName, }; use std::{collections::BTreeMap, str::FromStr}; diff --git a/crates/ndc-clickhouse/tests/query_builder.rs b/crates/ndc-clickhouse-core/tests/query_builder.rs similarity index 97% rename from crates/ndc-clickhouse/tests/query_builder.rs rename to crates/ndc-clickhouse-core/tests/query_builder.rs index 19d58c5..edc7b35 100644 --- a/crates/ndc-clickhouse/tests/query_builder.rs +++ b/crates/ndc-clickhouse-core/tests/query_builder.rs @@ -4,8 +4,8 @@ use common::{ schema::schema_response, }; use insta::{assert_snapshot, assert_yaml_snapshot, glob}; -use ndc_clickhouse::sql::QueryBuilder; -use ndc_sdk::models; +use ndc_clickhouse_core::sql::QueryBuilder; +use ndc_models as models; use schemars::schema_for; use std::{collections::HashMap, error::Error, fs, path::PathBuf}; @@ -24,7 +24,7 @@ async fn read_mock_configuration(schema_dir: &str) -> ServerConfig { ]); let config_dir = base_path().join(schema_dir).join("_config"); read_server_config( - config_dir, + config_dir.as_path(), &ConfigurationEnvironment::from_simulated_environment(env), ) .await diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_01_select_rows.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_01_select_rows.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_01_select_rows.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_01_select_rows.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_02_with_predicate.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_02_with_predicate.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_02_with_predicate.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_02_with_predicate.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_03_larger_predicate.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_03_larger_predicate.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_03_larger_predicate.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_03_larger_predicate.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_04_limit.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_04_limit.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_04_limit.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_04_limit.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_05_offset.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_05_offset.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_05_offset.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_05_offset.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_06_limit_offset.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_06_limit_offset.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_06_limit_offset.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_06_limit_offset.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_07_order_by.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_07_order_by.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_07_order_by.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_07_order_by.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_08_predicate_limit_offset_order_by.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_08_predicate_limit_offset_order_by.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/01_simple_queries_08_predicate_limit_offset_order_by.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/01_simple_queries_08_predicate_limit_offset_order_by.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_01_object_relationship.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_01_object_relationship.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_01_object_relationship.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_01_object_relationship.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_02_array_relationship.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_02_array_relationship.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_02_array_relationship.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_02_array_relationship.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_03_parent_predicate.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_03_parent_predicate.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_03_parent_predicate.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_03_parent_predicate.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_04_child_predicate.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_04_child_predicate.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_04_child_predicate.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_04_child_predicate.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_05_traverse_relationship_in_predicate.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_05_traverse_relationship_in_predicate.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_05_traverse_relationship_in_predicate.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_05_traverse_relationship_in_predicate.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_06_traverse_relationship_in_order_by.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_06_traverse_relationship_in_order_by.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_06_traverse_relationship_in_order_by.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_06_traverse_relationship_in_order_by.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_07_order_by_aggregate_across_relationships.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_07_order_by_aggregate_across_relationships.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/02_relationships_07_order_by_aggregate_across_relationships.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/02_relationships_07_order_by_aggregate_across_relationships.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/03_variables_01_simple_predicate.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/03_variables_01_simple_predicate.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/03_variables_01_simple_predicate.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/03_variables_01_simple_predicate.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/03_variables_02_empty_variable_sets.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/03_variables_02_empty_variable_sets.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/03_variables_02_empty_variable_sets.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/03_variables_02_empty_variable_sets.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/03_variables_03_single_set.request.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/03_variables_03_single_set.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/03_variables_03_single_set.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/03_variables_03_single_set.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/chinook/_config/configuration.json b/crates/ndc-clickhouse-core/tests/query_builder/chinook/_config/configuration.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/chinook/_config/configuration.json rename to crates/ndc-clickhouse-core/tests/query_builder/chinook/_config/configuration.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/01_bind_complex_parameters.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/01_bind_complex_parameters.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/01_bind_complex_parameters.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/01_bind_complex_parameters.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/01_complex_parameters_01_bind.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/01_complex_parameters_01_bind.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/01_complex_parameters_01_bind.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/01_complex_parameters_01_bind.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/01_complex_parameters_02_variables.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/01_complex_parameters_02_variables.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/01_complex_parameters_02_variables.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/01_complex_parameters_02_variables.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_01_generate_column_accessor.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_01_generate_column_accessor.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_01_generate_column_accessor.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_01_generate_column_accessor.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_02_skip_if_not_required.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_02_skip_if_not_required.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_02_skip_if_not_required.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_02_skip_if_not_required.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_03_support_relationships_on_nested_field.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_03_support_relationships_on_nested_field.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_03_support_relationships_on_nested_field.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_03_support_relationships_on_nested_field.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_05_complex_example.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_05_complex_example.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_05_complex_example.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_05_complex_example.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_06_no_useless_nested_accessors.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_06_no_useless_nested_accessors.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/02_column_accessor_06_no_useless_nested_accessors.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_column_accessor_06_no_useless_nested_accessors.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/02_variables_with_complex_parameters.request.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_variables_with_complex_parameters.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/02_variables_with_complex_parameters.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/02_variables_with_complex_parameters.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/complex_columns/_config/configuration.json b/crates/ndc-clickhouse-core/tests/query_builder/complex_columns/_config/configuration.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/complex_columns/_config/configuration.json rename to crates/ndc-clickhouse-core/tests/query_builder/complex_columns/_config/configuration.json diff --git a/crates/ndc-clickhouse/tests/query_builder/configuration.schema.json b/crates/ndc-clickhouse-core/tests/query_builder/configuration.schema.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/configuration.schema.json rename to crates/ndc-clickhouse-core/tests/query_builder/configuration.schema.json diff --git a/crates/ndc-clickhouse/tests/query_builder/request.schema.json b/crates/ndc-clickhouse-core/tests/query_builder/request.schema.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/request.schema.json rename to crates/ndc-clickhouse-core/tests/query_builder/request.schema.json diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/01_native_query.request.json b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/01_native_query.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/01_native_query.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/01_native_query.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/02_native_query_with_predicate.request.json b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/02_native_query_with_predicate.request.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/02_native_query_with_predicate.request.json rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/02_native_query_with_predicate.request.json diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/configuration.json b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/configuration.json similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/configuration.json rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/configuration.json diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q1.1.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q1.1.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q1.1.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q1.1.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q1.2.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q1.2.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q1.2.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q1.2.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q1.3.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q1.3.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q1.3.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q1.3.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q2.1.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q2.1.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q2.1.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q2.1.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q2.2.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q2.2.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q2.2.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q2.2.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q2.3.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q2.3.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q2.3.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q2.3.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.1.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.1.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.1.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.1.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.2.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.2.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.2.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.2.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.3.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.3.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.3.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.3.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.4.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.4.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q3.4.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q3.4.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q4.1.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q4.1.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q4.1.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q4.1.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q4.2.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q4.2.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q4.2.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q4.2.sql diff --git a/crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q4.3.sql b/crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q4.3.sql similarity index 100% rename from crates/ndc-clickhouse/tests/query_builder/star_schema/_config/queries/q4.3.sql rename to crates/ndc-clickhouse-core/tests/query_builder/star_schema/_config/queries/q4.3.sql diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_01_select_rows.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_01_select_rows.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_01_select_rows.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_01_select_rows.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_02_with_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_02_with_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_02_with_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_02_with_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_03_larger_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_03_larger_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_03_larger_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_03_larger_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_04_limit.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_04_limit.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_04_limit.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_04_limit.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_05_offset.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_05_offset.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_05_offset.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_05_offset.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_06_limit_offset.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_06_limit_offset.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_06_limit_offset.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_06_limit_offset.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_07_order_by.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_07_order_by.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_07_order_by.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_07_order_by.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_01_object_relationship.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_01_object_relationship.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_01_object_relationship.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_01_object_relationship.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_02_array_relationship.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_02_array_relationship.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_02_array_relationship.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_02_array_relationship.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_03_parent_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_03_parent_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_03_parent_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_03_parent_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_04_child_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_04_child_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_04_child_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_04_child_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_06_traverse_relationship_in_order_by.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_06_traverse_relationship_in_order_by.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_06_traverse_relationship_in_order_by.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_06_traverse_relationship_in_order_by.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_07_order_by_aggregate_across_relationships.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_07_order_by_aggregate_across_relationships.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_07_order_by_aggregate_across_relationships.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@02_relationships_07_order_by_aggregate_across_relationships.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_01_simple_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_01_simple_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_01_simple_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_01_simple_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_02_empty_variable_sets.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_02_empty_variable_sets.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_02_empty_variable_sets.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_02_empty_variable_sets.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_03_single_set.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_03_single_set.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_03_single_set.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Inlined SQL@03_variables_03_single_set.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_02_with_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_02_with_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_02_with_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_02_with_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_03_larger_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_03_larger_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_03_larger_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_03_larger_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_03_parent_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_03_parent_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_03_parent_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_03_parent_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_04_child_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_04_child_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_04_child_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_04_child_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@02_relationships_05_traverse_relationship_in_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_01_simple_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_01_simple_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_01_simple_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_01_simple_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_02_empty_variable_sets.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_02_empty_variable_sets.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_02_empty_variable_sets.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_02_empty_variable_sets.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_03_single_set.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_03_single_set.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_03_single_set.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameterized SQL@03_variables_03_single_set.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_02_with_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_02_with_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_02_with_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_02_with_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_03_larger_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_03_larger_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_03_larger_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_03_larger_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@01_simple_queries_08_predicate_limit_offset_order_by.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@02_relationships_03_parent_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@02_relationships_03_parent_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@02_relationships_03_parent_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@02_relationships_03_parent_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@02_relationships_04_child_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@02_relationships_04_child_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@02_relationships_04_child_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@02_relationships_04_child_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@02_relationships_05_traverse_relationship_in_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@02_relationships_05_traverse_relationship_in_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@02_relationships_05_traverse_relationship_in_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@02_relationships_05_traverse_relationship_in_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@03_variables_01_simple_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@03_variables_01_simple_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@03_variables_01_simple_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@03_variables_01_simple_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@03_variables_02_empty_variable_sets.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@03_variables_02_empty_variable_sets.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@03_variables_02_empty_variable_sets.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@03_variables_02_empty_variable_sets.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@03_variables_03_single_set.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@03_variables_03_single_set.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Parameters@03_variables_03_single_set.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Parameters@03_variables_03_single_set.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Schema Response.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Schema Response.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__chinook Schema Response.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__chinook Schema Response.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Expected Error@02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Expected Error@02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Expected Error@02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Expected Error@02_column_accessor_04_error_on_relationships_on_array_nested_field.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@01_bind_complex_parameters.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@01_bind_complex_parameters.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@01_bind_complex_parameters.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@01_bind_complex_parameters.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_01_bind.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_01_bind.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_01_bind.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_01_bind.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_02_variables.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_02_variables.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_02_variables.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@01_complex_parameters_02_variables.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_01_generate_column_accessor.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_01_generate_column_accessor.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_01_generate_column_accessor.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_01_generate_column_accessor.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_02_skip_if_not_required.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_02_skip_if_not_required.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_02_skip_if_not_required.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_02_skip_if_not_required.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_03_support_relationships_on_nested_field.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_03_support_relationships_on_nested_field.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_03_support_relationships_on_nested_field.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_03_support_relationships_on_nested_field.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_05_complex_example.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_05_complex_example.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_05_complex_example.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_05_complex_example.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_06_no_useless_nested_accessors.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_06_no_useless_nested_accessors.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_06_no_useless_nested_accessors.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_column_accessor_06_no_useless_nested_accessors.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_variables_with_complex_parameters.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_variables_with_complex_parameters.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Inlined SQL@02_variables_with_complex_parameters.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Inlined SQL@02_variables_with_complex_parameters.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_bind_complex_parameters.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_bind_complex_parameters.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_bind_complex_parameters.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_bind_complex_parameters.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_01_bind.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_01_bind.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_01_bind.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_01_bind.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_02_variables.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_02_variables.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_02_variables.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@01_complex_parameters_02_variables.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@02_variables_with_complex_parameters.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@02_variables_with_complex_parameters.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameterized SQL@02_variables_with_complex_parameters.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameterized SQL@02_variables_with_complex_parameters.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@01_bind_complex_parameters.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@01_bind_complex_parameters.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@01_bind_complex_parameters.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@01_bind_complex_parameters.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_01_bind.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_01_bind.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_01_bind.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_01_bind.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_02_variables.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_02_variables.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_02_variables.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@01_complex_parameters_02_variables.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@02_variables_with_complex_parameters.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@02_variables_with_complex_parameters.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Parameters@02_variables_with_complex_parameters.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Parameters@02_variables_with_complex_parameters.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Schema Response.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Schema Response.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__complex_columns Schema Response.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__complex_columns Schema Response.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Inlined SQL@01_native_query.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Inlined SQL@01_native_query.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Inlined SQL@01_native_query.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Inlined SQL@01_native_query.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Inlined SQL@02_native_query_with_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Inlined SQL@02_native_query_with_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Inlined SQL@02_native_query_with_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Inlined SQL@02_native_query_with_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Parameterized SQL@02_native_query_with_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Parameterized SQL@02_native_query_with_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Parameterized SQL@02_native_query_with_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Parameterized SQL@02_native_query_with_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Parameters@02_native_query_with_predicate.request.json.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Parameters@02_native_query_with_predicate.request.json.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Parameters@02_native_query_with_predicate.request.json.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Parameters@02_native_query_with_predicate.request.json.snap diff --git a/crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Schema Response.snap b/crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Schema Response.snap similarity index 100% rename from crates/ndc-clickhouse/tests/snapshots/query_builder__star_schema Schema Response.snap rename to crates/ndc-clickhouse-core/tests/snapshots/query_builder__star_schema Schema Response.snap diff --git a/crates/ndc-clickhouse/Cargo.toml b/crates/ndc-clickhouse/Cargo.toml index 000a526..1174ffd 100644 --- a/crates/ndc-clickhouse/Cargo.toml +++ b/crates/ndc-clickhouse/Cargo.toml @@ -4,26 +4,6 @@ version.workspace = true edition.workspace = true [dependencies] -async-trait = "0.1.78" -bytes = "1.6.0" -common = { path = "../common" } -http = "0.2" -indexmap = "2.1.0" -ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs", tag = "v0.4.0", package = "ndc-sdk" } -prometheus = "0.13.3" -reqwest = { version = "0.12.3", features = [ - "json", - "rustls-tls", -], default-features = false } -schemars = "0.8.16" -serde = { version = "1.0.197", features = ["derive"] } -serde_json = "1.0.114" -sqlformat = "0.2.3" -strum = { version = "0.26.3", features = ["derive"] } -thiserror = "1.0.64" +ndc-sdk = { workspace = true } +ndc-clickhouse-core = { path = "../ndc-clickhouse-core" } tokio = "1.36.0" -tracing = "0.1.40" - -[dev-dependencies] -insta = { version = "1.40.0", features = ["yaml", "glob", "json"] } -schemars = "0.8.16" diff --git a/crates/ndc-clickhouse/src/main.rs b/crates/ndc-clickhouse/src/main.rs index 2b64860..23e4616 100644 --- a/crates/ndc-clickhouse/src/main.rs +++ b/crates/ndc-clickhouse/src/main.rs @@ -1,4 +1,4 @@ -use ndc_clickhouse::connector::setup::ClickhouseConnectorSetup; +use ndc_clickhouse_core::connector::setup::ClickhouseConnectorSetup; use ndc_sdk::{connector::ErrorResponse, default_main::default_main}; #[tokio::main]