Skip to content

feat(db): PostgresTransaction.find_one_and_update for work-kernel CAS - #46

Merged
eldonm merged 1 commit into
mainfrom
feat/txn-find-one-and-update
Sep 19, 2026
Merged

eldonm merged 1 commit into
mainfrom
feat/txn-find-one-and-update

Conversation

@eldonm

@eldonm eldonm commented Sep 19, 2026

Copy link
Copy Markdown
Member

Summary

  • Add PostgresTransaction.find_one_and_update on the held connection (SELECT … FOR UPDATE + upsert) so CAS and insert_if_absent share one public transaction.
  • Unit + Postgres integration coverage for commit/rollback atomicity of transition + outbox-style inserts.
  • Bump to 0.0.21.

Test plan

  • pytest tests/db/test_postgres_transaction_cas.py
  • JVSPATIAL_POSTGRES_TEST_DSN=… pytest tests/db/test_postgres_integration.py::TestPostgresTransactionAtomicOps
  • CI green; publish 0.0.21 after merge

Made with Cursor

@github-actions

Copy link
Copy Markdown

Benchmark comparison

Threshold: ±25% (informational, does not block merge)

benchmark baseline (s) current (s) delta status
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_deferred_save_batched_100 0.027124 0.027017 -0.4% OK
tests/benchmarks/test_deferred_save_benchmarks.py::test_bench_immediate_save_100 0.025936 0.026546 +2.4% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_batched_saves_500 0.481181 0.511261 +6.3% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_empty_query 1.035469 1.109399 +7.1% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_count_filtered 1.138170 1.191172 +4.7% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_find_filtered 0.874956 0.904351 +3.4% OK
tests/benchmarks/test_jsondb_benchmarks.py::test_bench_jsondb_save_throughput 0.001628 0.001714 +5.3% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_empty 0.349256 0.367945 +5.4% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_fallback_via_regex 0.385497 0.383738 -0.5% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_count_pushdown 0.351821 0.360920 +2.6% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_fallback_via_regex 0.381254 0.404738 +6.2% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_find_pushdown 0.353870 0.332799 -6.0% OK
tests/benchmarks/test_sqlite_benchmarks.py::test_bench_sqlite_sort_limit_pushdown 0.375982 0.382539 +1.7% OK

@eldonm
eldonm merged commit 65fe03a into main Sep 19, 2026
6 checks passed
@eldonm
eldonm deleted the feat/txn-find-one-and-update branch September 19, 2026 04:29
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.

1 participant