Skip to content

SODA: update, delete, and bulk insert (#202)#209

Merged
lemenkov merged 1 commit into
masterfrom
soda-4-update-delete-202
Jun 25, 2026
Merged

SODA: update, delete, and bulk insert (#202)#209
lemenkov merged 1 commit into
masterfrom
soda-4-update-delete-202

Conversation

@lemenkov

Copy link
Copy Markdown
Owner

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)SodaDocument with the new key/version/metadata, or None if nothing matched
  • find()...remove() → number of documents removed (key- or filter-scoped)
  • collection.insertMany(docs) → bulk insert in one round trip

RE notes

  • 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, PL/SQL associative-array (collection) binds #122); save/saveAndGet are left out for now.
  • replace_one returns a NUMBER (1/0), replace_one_and_get a SODA_DOCUMENT_T (NULL → None), remove the 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

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>
@lemenkov lemenkov added this to the 1.10.0 milestone Jun 25, 2026
@lemenkov
lemenkov merged commit 7e58a82 into master Jun 25, 2026
10 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.

SODA: update, delete, and bulk insert

1 participant