diff --git a/Cargo.lock b/Cargo.lock index 383e1188..bbf2d61b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -126,6 +126,21 @@ dependencies = [ "thiserror", ] +[[package]] +name = "async-compression" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddb939d66e4ae03cee6091612804ba446b12878410cfa17f785f4dd67d4014e8" +dependencies = [ + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "zstd", + "zstd-safe", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -371,6 +386,8 @@ version = "1.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -1570,6 +1587,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.69" @@ -1952,8 +1978,8 @@ dependencies = [ [[package]] name = "ndc-models" -version = "0.2.0" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.2.0#e25213f51a7e8422d712509d63ae012c67b4f3f1" +version = "0.2.4" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.2.4#df67fa6469431f9304aac9c237e9d2327d20da20" dependencies = [ "indexmap 2.2.6", "ref-cast", @@ -1986,8 +2012,8 @@ dependencies = [ [[package]] name = "ndc-sdk" -version = "0.6.0" -source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=v0.6.0#f8db8bff28c42f7da317a2336808bb7149408205" +version = "0.8.0" +source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=v0.8.0#0c93ded023767c8402ace015aff5023115d8dcb6" dependencies = [ "async-trait", "axum", @@ -2018,8 +2044,8 @@ dependencies = [ [[package]] name = "ndc-sdk-core" -version = "0.6.0" -source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=v0.6.0#f8db8bff28c42f7da317a2336808bb7149408205" +version = "0.8.0" +source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=v0.8.0#0c93ded023767c8402ace015aff5023115d8dcb6" dependencies = [ "async-trait", "axum", @@ -2038,14 +2064,15 @@ dependencies = [ [[package]] name = "ndc-test" -version = "0.2.0" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.2.0#e25213f51a7e8422d712509d63ae012c67b4f3f1" +version = "0.2.4" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.2.4#df67fa6469431f9304aac9c237e9d2327d20da20" dependencies = [ "async-trait", "clap", "colorful", "indexmap 2.2.6", "ndc-models", + "pretty_assertions", "rand", "reqwest 0.12.4", "semver", @@ -2053,6 +2080,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", + "url", ] [[package]] @@ -2430,9 +2458,9 @@ dependencies = [ [[package]] name = "pretty_assertions" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" dependencies = [ "diff", "yansi", @@ -3593,6 +3621,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ + "async-compression", "bitflags 2.5.0", "bytes", "futures-core", @@ -3602,6 +3631,8 @@ dependencies = [ "http-range-header", "mime", "pin-project-lite", + "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -4232,9 +4263,9 @@ dependencies = [ [[package]] name = "yansi" -version = "0.5.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" @@ -4328,3 +4359,31 @@ dependencies = [ "quote", "syn 2.0.66", ] + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.15+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 4d733e8d..6300b317 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ resolver = "2" # The tag or rev of ndc-models must match the locked tag or rev of the # ndc-models dependency of ndc-sdk [workspace.dependencies] -ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", rev = "v0.6.0" } -ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.2.0" } +ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", rev = "v0.8.0" } +ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.2.4" } indexmap = { version = "2", features = [ "serde", diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 97078af1..64d1b3ce 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -38,7 +38,7 @@ mongodb-agent-common = { path = "../mongodb-agent-common", features = ["test-hel async-tempfile = "^0.6.0" googletest = "^0.13.0" -pretty_assertions = "1" +pretty_assertions = "1.4" proptest = "1" ndc-test-helpers = { path = "../ndc-test-helpers" } test-helpers = { path = "../test-helpers" } diff --git a/crates/configuration/src/configuration.rs b/crates/configuration/src/configuration.rs index c5007639..57291713 100644 --- a/crates/configuration/src/configuration.rs +++ b/crates/configuration/src/configuration.rs @@ -297,6 +297,7 @@ fn collection_to_collection_info( description: collection.description, arguments: Default::default(), uniqueness_constraints: BTreeMap::from_iter(pk_constraint), + relational_mutations: None, } } @@ -318,6 +319,7 @@ fn native_query_to_collection_info( description: native_query.description.clone(), arguments: arguments_to_ndc_arguments(native_query.arguments.clone()), uniqueness_constraints: BTreeMap::from_iter(pk_constraint), + relational_mutations: None, } } diff --git a/crates/mongodb-agent-common/Cargo.toml b/crates/mongodb-agent-common/Cargo.toml index 639d00ef..900e3979 100644 --- a/crates/mongodb-agent-common/Cargo.toml +++ b/crates/mongodb-agent-common/Cargo.toml @@ -30,7 +30,7 @@ mongodb = { workspace = true } ndc-models = { workspace = true } nonempty = { workspace = true } once_cell = "1" -pretty_assertions = { version = "1", optional = true } +pretty_assertions = { version = "1.4", optional = true } regex = "1" schemars = { version = "^0.8.12", features = ["smol_str"] } serde = { workspace = true } @@ -46,6 +46,6 @@ ndc-test-helpers = { path = "../ndc-test-helpers" } test-helpers = { path = "../test-helpers" } mockall = "^0.13.1" -pretty_assertions = "1" +pretty_assertions = "1.4" proptest = "1" tokio = { version = "1", features = ["full"] } diff --git a/crates/mongodb-agent-common/src/test_helpers.rs b/crates/mongodb-agent-common/src/test_helpers.rs index 38f31651..c265c915 100644 --- a/crates/mongodb-agent-common/src/test_helpers.rs +++ b/crates/mongodb-agent-common/src/test_helpers.rs @@ -20,6 +20,7 @@ pub fn make_nested_schema() -> MongoConfiguration { collection_type: "Author".into(), arguments: Default::default(), uniqueness_constraints: make_primary_key_uniqueness_constraint("authors"), + relational_mutations: None, }, ), collection("appearances"), // new helper gives more concise syntax diff --git a/crates/mongodb-connector/Cargo.toml b/crates/mongodb-connector/Cargo.toml index 26c0ec6e..8cfb001f 100644 --- a/crates/mongodb-connector/Cargo.toml +++ b/crates/mongodb-connector/Cargo.toml @@ -27,4 +27,4 @@ tracing = "0.1" [dev-dependencies] ndc-test-helpers = { path = "../ndc-test-helpers" } -pretty_assertions = "1" +pretty_assertions = "1.4" diff --git a/crates/mongodb-connector/src/capabilities.rs b/crates/mongodb-connector/src/capabilities.rs index 6e7a5724..ce739614 100644 --- a/crates/mongodb-connector/src/capabilities.rs +++ b/crates/mongodb-connector/src/capabilities.rs @@ -44,5 +44,7 @@ pub fn mongo_capabilities() -> Capabilities { order_by_aggregate: None, nested: None, // TODO: ENG-1490 }), + relational_mutation: None, + relational_query: None, } } diff --git a/crates/mongodb-connector/src/mongo_connector.rs b/crates/mongodb-connector/src/mongo_connector.rs index 648b5548..41ffd845 100644 --- a/crates/mongodb-connector/src/mongo_connector.rs +++ b/crates/mongodb-connector/src/mongo_connector.rs @@ -67,6 +67,14 @@ impl Connector for MongoConnector { type Configuration = MongoConfiguration; type State = ConnectorState; + fn connector_name() -> &'static str { + "ndc_mongodb" + } + + fn connector_version() -> &'static str { + env!("CARGO_PKG_VERSION") + } + #[instrument(err, skip_all)] fn fetch_metrics( _configuration: &Self::Configuration, diff --git a/crates/mongodb-connector/src/schema.rs b/crates/mongodb-connector/src/schema.rs index 6dc867cf..6e6add5c 100644 --- a/crates/mongodb-connector/src/schema.rs +++ b/crates/mongodb-connector/src/schema.rs @@ -28,6 +28,7 @@ pub async fn get_schema(config: &MongoConfiguration) -> connector::Result TestContext { collection_type: "Author".into(), arguments: Default::default(), uniqueness_constraints: make_primary_key_uniqueness_constraint("authors"), + relational_mutations: None, }, ), ( @@ -265,6 +266,7 @@ pub fn make_flat_schema() -> TestContext { collection_type: "Article".into(), arguments: Default::default(), uniqueness_constraints: make_primary_key_uniqueness_constraint("articles"), + relational_mutations: None, }, ), ]), @@ -301,6 +303,7 @@ pub fn make_nested_schema() -> TestContext { collection_type: "Author".into(), arguments: Default::default(), uniqueness_constraints: make_primary_key_uniqueness_constraint("authors"), + relational_mutations: None, }, ), collection("appearances"), // new helper gives more concise syntax diff --git a/crates/ndc-test-helpers/src/collection_info.rs b/crates/ndc-test-helpers/src/collection_info.rs index 040a8694..0862f85a 100644 --- a/crates/ndc-test-helpers/src/collection_info.rs +++ b/crates/ndc-test-helpers/src/collection_info.rs @@ -9,6 +9,7 @@ pub fn collection(name: impl Display + Clone) -> (ndc_models::CollectionName, Co arguments: Default::default(), collection_type: name.to_string().into(), uniqueness_constraints: make_primary_key_uniqueness_constraint(name.clone()), + relational_mutations: None, }; (name.to_string().into(), coll) } diff --git a/crates/ndc-test-helpers/src/lib.rs b/crates/ndc-test-helpers/src/lib.rs index 1d79d525..8843b3c5 100644 --- a/crates/ndc-test-helpers/src/lib.rs +++ b/crates/ndc-test-helpers/src/lib.rs @@ -135,6 +135,7 @@ impl From for QueryRequest { arguments: value.arguments.unwrap_or_default(), collection_relationships: value.collection_relationships.unwrap_or_default(), variables: value.variables, + request_arguments: None, } } }