-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: remove v2 types #71
Conversation
crates/mongodb-agent-common/src/interface_types/mongo_agent_error.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. This is a big improvement. Just a few minor suggested changes.
It might be useful to move the ndc-query-plan
crate to the SDK at some point so it can be used by other connectors.
Co-authored-by: David Overton <dmoverton@users.noreply.github.com>
Thanks! I had the same thought. |
Removes v2 types, and replaces them with a new set of internal types that closely match ndc models. The root of the new types is called
QueryPlan
instead ofQueryRequest
. It is a denormalized version of a query request. In particularQuerPlan
Type
type that inlines object type referencesQueryRequest
level, the new types have a map on eachQuery
value for relations with that query's collection as a source, and that are referenced in that query)QueryPlan
level (the analog ofQueryRequest
) for existence checks on unrelated collectionsThe changes simplify emitting MongoDB aggregation code, and lower the impedence mismatch to using features of v3 that aren't reflected in v2.
I preserved and updated all the existing tests except one that tests filtering by fields of a nested object of a related collection which is something that worked in v2, but will require an update to the latest ndc-spec to work in v3.
There are some more changes necessary for filtering and sorting by fields of a related collection. We need to adjust the way query request expressions map to MongoDB expressions. I thought it would be best to get this refactor in, and put those changes in a separate PR.