Skip to content

Fix D1 Worker cursor results and add regression coverage - #37

Merged
CollierKing merged 1 commit into
mainfrom
fix/d1-worker-cursor-results
Oct 2, 2026
Merged

CollierKing merged 1 commit into
mainfrom
fix/d1-worker-cursor-results

Conversation

@CollierKing

@CollierKing CollierKing commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Fix Python Worker reads that lose values when columns share a name, or lose column names when a query returns no rows. For example, SELECT 1 AS id, 7 AS id now preserves both values and both column names.

Builds on @danielalyoshin’s already-merged #33 and #34, which fixed row-returning statement detection and positional REST results.

Changes:

  1. Preserve duplicate columns, NULLs, and empty-result headers through sync/async Worker cursors and SQLAlchemy, including commented queries, WITH, VALUES, and EXPLAIN reads.
  2. Execute each statement once while preserving affected-row counts and generated IDs for writes, including WITH-prefixed inserts.
  3. Add regression coverage and correct Worker test-server readiness and remote-binding handling.
  4. Prepare version 0.4.1 with a changelog covering the contributor fixes and this Worker follow-up.

Validation:

  1. 87 unit tests passed; CI passed on Python 3.9–3.12.
  2. Focused result-handling regressions passed against real D1, including 11 Worker checks and the async SQLAlchemy REST join regression.
  3. 46 additional REST and 40 additional Worker regressions passed against real D1, covering table/constraint reflection, Core/ORM CRUD, generated IDs, binary/JSON data, booleans, dates/times, UUIDs, and enums.
  4. Ruff lint/format, spelling, pre-commit, mypy, and the 0.4.1 package build passed. Mypy runs manually and is not enforced by CI or pre-commit.
  5. Validation covered selected D1 regressions; the full repository integration suite was not run.

@CollierKing CollierKing changed the title Add async SQLAlchemy result regression coverage Fix D1 Worker cursor results and add regression coverage Oct 2, 2026
@CollierKing
CollierKing marked this pull request as ready for review October 2, 2026 02:13
@CollierKing
CollierKing force-pushed the fix/d1-worker-cursor-results branch from 050182b to d0a9fb8 Compare October 2, 2026 02:30
@CollierKing
CollierKing merged commit 7b127f4 into main Oct 2, 2026
8 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.

1 participant