这是indexloc提供的服务,不要输入任何密码
Skip to content

Bump SDK to 0.8 #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 71 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
2 changes: 2 additions & 0 deletions crates/configuration/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand All @@ -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,
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/mongodb-agent-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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"] }
1 change: 1 addition & 0 deletions crates/mongodb-agent-common/src/test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/mongodb-connector/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ tracing = "0.1"

[dev-dependencies]
ndc-test-helpers = { path = "../ndc-test-helpers" }
pretty_assertions = "1"
pretty_assertions = "1.4"
2 changes: 2 additions & 0 deletions crates/mongodb-connector/src/capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ pub fn mongo_capabilities() -> Capabilities {
order_by_aggregate: None,
nested: None, // TODO: ENG-1490
}),
relational_mutation: None,
relational_query: None,
}
}
8 changes: 8 additions & 0 deletions crates/mongodb-connector/src/mongo_connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions crates/mongodb-connector/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub async fn get_schema(config: &MongoConfiguration) -> connector::Result<ndc::S
}),
}),
}),
request_arguments: None,
};
tracing::debug!(schema = %serde_json::to_string(&schema).unwrap(), "get_schema");
Ok(schema)
Expand Down
2 changes: 1 addition & 1 deletion crates/ndc-query-plan/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ ndc-test-helpers = { path = "../ndc-test-helpers" }
anyhow = "1"
enum-iterator = "2"
lazy_static = "1"
pretty_assertions = "1"
pretty_assertions = "1.4"
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ pub fn make_flat_schema() -> TestContext {
collection_type: "Author".into(),
arguments: Default::default(),
uniqueness_constraints: make_primary_key_uniqueness_constraint("authors"),
relational_mutations: None,
},
),
(
Expand All @@ -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,
},
),
]),
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions crates/ndc-test-helpers/src/collection_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions crates/ndc-test-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ impl From<QueryRequestBuilder> for QueryRequest {
arguments: value.arguments.unwrap_or_default(),
collection_relationships: value.collection_relationships.unwrap_or_default(),
variables: value.variables,
request_arguments: None,
}
}
}
Expand Down