Skip to content

Refactor internal query events and share execution preparation - #1533

Merged
lovasoa merged 6 commits into
mainfrom
codex/cleanup-query-events
Oct 9, 2026
Merged

lovasoa merged 6 commits into
mainfrom
codex/cleanup-query-events

Conversation

@lovasoa

@lovasoa lovasoa commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Database completion and error results currently carry empty row inputs and a zero column count. Replace that internal representation with Result<QueryEvent>, keeping row inputs and output column counts exclusively on decoded rows and preserving the outward DbItem stream.

Share database fetch timing, span instrumentation, decoding, row counting, and row preparation between scalar and streaming execution. Keep their consumption loops explicit and retain the boundary that releases the database stream's connection borrow before evaluating buffered columns, including nested sqlpage.run_sql with a one-connection pool.

Reuse the existing SQL fixture runner and transaction tests for regression coverage:

  • Existing scalar fixtures cover zero rows and each database's multiple-row policy; extend the existing function fixture with a database-backed computed scalar.
  • Keep the existing static scalar column-count fixture and exercise duplicate physical column names through the same runner.
  • Compare complete serialized rows to check private-input omission, duplicate values, ordering, and nested buffered/scalar run_sql on the runner's one-connection pool. Extend the SQLite scalar fixture with exact duplicate JSON output checks.
  • Extend the existing transaction test to verify computed-column failure rolls back inserted data and leaves the pool usable.
  • Retain one direct execution test for dropping an unfinished stream and reusing its connection, which needs access to the borrowed DbConn.

The execution test block shrinks from 227 lines to 49; the other checks use 30 lines of SQL fixtures and small extensions to existing harnesses. No separate setup or row-collection helper remains.

Validation:

  • cargo fmt --all and formatting check passed.
  • cargo clippy --all-targets --all-features -- -D warnings passed.
  • cargo test --features odbc-static passed: 236 unit tests and 89 integration tests with in-memory SQLite. Local fixture servers required running the suite outside the network sandbox.
  • Other database engines could not be exercised locally: the container runtime is a Podman wrapper and its local socket denies access. The database matrix remains for CI.

Testing guidance in AGENTS.md and CONTRIBUTING.md now lists the six CI databases and driver requirements, explains numeric JSON, scalar cardinality, variable precedence/NULL, physical-versus-computed column order, and existing fixture conventions. It also requires reusing test structures without losing scenarios. Documentation links and matrix entries were checked against the repository.

CI limitation: Oracle integration assertions were also verified locally against Oracle 23.26.2 / Instant Client 23.26 (all 89 passed), but the process hangs during native driver finalization (finiSqora -> bccFreeProcess). This also occurs on unchanged base main commit c12c154 (baseline Oracle job). Serial test execution still hangs; no success override, test skip, or timeout relaxation was added. This is not reported as an overall Oracle test pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T11:16:08.828512Z 01d6267 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lovasoa
lovasoa added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit bf297b2 Oct 9, 2026
19 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