Skip to content

fix: encode composite PKs in bulk responses - #1193

Open
8dazo wants to merge 2 commits into
aio-libs:masterfrom
8dazo:fix/composite-pk-bulk-ids
Open

fix: encode composite PKs in bulk responses#1193
8dazo wants to merge 2 commits into
aio-libs:masterfrom
8dazo:fix/composite-pk-bulk-ids

Conversation

@8dazo

@8dazo 8dazo commented Aug 17, 2026

Copy link
Copy Markdown

Summary

  • updateMany / deleteMany now return full pipe-joined IDs for composite primary keys ("1|2"), matching getList / getOne / getMany.
  • SQLAlchemy bulk methods return every RETURNING PK column instead of scalars() (first column only).
  • _convert_ids uses the same "|".join(...) encoding as _convert_record.
  • Adds test_composite_pk_api covering list, get, update, bulk update, and bulk delete.

Fixes #1192

Test plan

  • pytest tests/test_backends_sqlalchemy.py::test_composite_pk_api
  • Single-PK bulk tests still pass (test_update_many, test_delete_many)
  • CI green on this PR

Made with Cursor

updateMany/deleteMany used scalars() and str(id), so compound
keys came back as "1" instead of "1|2" and broke react-admin.

Fixes aio-libs#1192

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "fix: avoid ReturningDelete reassignment ..." | Re-trigger Greptile

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.85%. Comparing base (ef6fc55) to head (f2bf2f7).
⚠️ Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1193      +/-   ##
==========================================
+ Coverage   95.76%   95.85%   +0.08%     
==========================================
  Files          21       21              
  Lines        2955     3014      +59     
  Branches      193      200       +7     
==========================================
+ Hits         2830     2889      +59     
  Misses        100      100              
  Partials       25       25              
Flag Coverage Δ
integration 81.24% <50.00%> (-0.42%) ⬇️
js 83.96% <ø> (ø)
unit 97.64% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Bulk update/delete returns incomplete IDs for composite primary keys

1 participant