Skip to content

feat: add upsert and partial update APIs#84

Merged
dcfocus merged 2 commits into
mainfrom
codex/issue-81-upsert-update
Jun 12, 2026
Merged

feat: add upsert and partial update APIs#84
dcfocus merged 2 commits into
mainfrom
codex/issue-81-upsert-update

Conversation

@dcfocus

@dcfocus dcfocus commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add first-class append-only upsert by external_id in core, API trait, unified store, remote client, REST PUT /records, and Python sync/async APIs.
  • Add partial update by id or external_id across core, API trait, unified store, remote client, REST PATCH /records, and Python sync/async APIs.
  • Preserve identity, payload, embedding, and history for updates by writing a replacement record with supersedes_id while patching mutable metadata, relationships, scoping, and lifecycle fields.

Closes #81.

Notes

  • The initial patch API sets provided fields and leaves omitted fields unchanged. Explicit null/clear semantics can be a follow-up if maintainers want that behavior.

Testing

  • PASS: cargo-fmt --all --check
  • PASS: cargo test --workspace
  • PASS: cargo test -p lance-context --features remote
  • PASS: cargo clippy --workspace --all-targets -- -D warnings
  • PASS: uv run --project python --extra dev ruff format --check python/python/lance_context/api.py python/tests/test_search.py python/tests/test_persistence.py
  • PASS: uv run --project python --extra dev ruff check python/python/lance_context/api.py python/tests/test_search.py python/tests/test_persistence.py
  • PASS: uv run --project python --extra dev pyright python/python/lance_context/api.py python/tests/test_search.py
  • PASS: uv run --project python --extra tests --reinstall-package lance-context pytest python/tests/test_search.py::test_context_update_requires_identifier_and_patch python/tests/test_search.py::test_context_update_returns_operation_metadata_and_record python/tests/test_search.py::test_context_update_missing_record_returns_not_updated -q
  • PASS: uv run --project python --extra tests --reinstall-package lance-context pytest python/tests/test_persistence.py::test_update_by_external_id_patches_mutable_fields_and_preserves_payload -q
  • NOTE: full-project pyright still reports pre-existing unrelated issues in examples/mcp-claude-code, python/tests/test_distance_metric.py, and older generator annotations in python/tests/test_persistence.py.

@dcfocus dcfocus changed the title feat: add upsert by external id feat: add upsert and partial update APIs Jun 12, 2026
@dcfocus dcfocus mentioned this pull request Jun 12, 2026
25 tasks
@dcfocus dcfocus merged commit 4627aca into main Jun 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add first-class upsert/update API (insert-or-replace by external_id; partial field update)

1 participant