SODA: update, delete, and bulk insert (#202)#209
Merged
Conversation
Fourth step of the #163 SODA umbrella, completing document CRUD: - SodaOperation.replaceOne(doc) -> bool (replaced or not) and replaceOneAndGet(doc) -> a SodaDocument with the new key/version/metadata (None if nothing matched). - SodaOperation.remove() -> number of documents removed (key- or filter-scoped). - SodaCollection.insertMany(docs) -> bulk insert in one round trip. RE note: DBMS_SODA's native insert_many and save are ORA-03001 "unimplemented feature" in thin mode, so insertMany loops insert_one over a host array of contents (cursor.arrayvar, #122); save / saveAndGet are left out for now. replace_one returns a NUMBER (1/0), replace_one_and_get a SODA_DOCUMENT_T (NULL when nothing matches), remove the deleted count. Sync + async; 23ai/21c pass, 11g/9i skip. Per-document content keeps the 32767-byte inline limit from #200. Closes #202 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth step of the #163 SODA umbrella, completing document CRUD over
DBMS_SODA.API (sync + async)
find()...replaceOne(doc)→ bool (replaced or not)find()...replaceOneAndGet(doc)→SodaDocumentwith the new key/version/metadata, orNoneif nothing matchedfind()...remove()→ number of documents removed (key- or filter-scoped)collection.insertMany(docs)→ bulk insert in one round tripRE notes
insert_manyandsaveare ORA-03001 "unimplemented feature" in thin mode, soinsertManyloopsinsert_oneover a host array of contents (cursor.arrayvar, PL/SQL associative-array (collection) binds #122);save/saveAndGetare left out for now.replace_onereturns a NUMBER (1/0),replace_one_and_getaSODA_DOCUMENT_T(NULL → None),removethe deleted count.Tests: live replaceOne (match/no-match), replaceOneAndGet (match/no-match), remove (by key and by filter), insertMany — sync + async, 23ai/21c pass, 11g/9i skip. Offline 527. Content keeps the 32767-byte inline limit from #200.
Closes #202
🤖 Generated with Claude Code