-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add upsert and unique checking in local mode [DRAFT] #104
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds upsert functionality and unique field verification for local (file-based) mode, including improvements to client configuration and documentation support. Key changes include:
- New variadic Upsert method and local-mode support in client.go.
- Additional tests covering upsert, unique constraints, and embedded object handling.
- Documentation updates in README and added configuration options (e.g. maxEdgeTraversal).
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
upsert_test.go | Added tests for basic and predicate-based upsert operations. |
update_test.go | Expanded update tests to cover unique constraints and batch update scenarios. |
mutate.go | Introduced unique verification and recursive upsert support, with improved handling of slice and single object. |
internal_test.go | Added structural tag tests to ensure proper processing of unique/upsert directives. |
insert_test.go | Enhanced insertion tests with embedded objects and depth query adjustments. |
client.go | Updated API design with optional upsert predicates, new client options (maxEdgeTraversal), and local-mode logic. |
README.md | Revised documentation to reflect local-mode limitations and new upsert features. |
Comments suppressed due to low confidence (2)
client.go:258
- [nitpick] Consider renaming the internal upsert helper function (e.g. to 'localUpsert') to clearly distinguish it from the public Upsert method, reducing potential confusion during maintenance.
func (c client) Upsert(ctx context.Context, obj any, predicates ...string) error {
engine.go:82
- Please add a comment explaining the rationale for choosing the value 100000 for TypeFilterUidLimit to aid future maintainers.
worker.Config.TypeFilterUidLimit = 100000
Description
This PR adds upsert and unique checking to modusGraph in "local" mode.
Checklist
CHANGELOG.md
file describing and linking tothis PR