Skip to content

Keep raw cursor transaction calls and attribute lookups as they were - #232

Merged
leonardovida merged 1 commit into
mainfrom
fix/cursor-raw-call-routing
Nov 17, 2026
Merged

leonardovida merged 1 commit into
mainfrom
fix/cursor-raw-call-routing

Conversation

@leonardovida

Copy link
Copy Markdown
Owner

Summary

A review of the unreleased changes found two regressions from routing raw DBAPI cursor calls through the connection wrapper in #230:

  • begin(), commit() and rollback() on a DBAPI cursor resolved to the wrapper's methods. Under isolation_level="AUTOCOMMIT" cursor.begin() no longer opened a transaction, and the calls returned None instead of the DuckDB connection. They are DuckDB's own methods again.
  • Looking up a routed method without calling it, as hasattr(cursor, "register") does, buffered the open result. The buffering now happens when the method is called.

Documentation for duckdb_sequence_name:

  • A reflected column also needs its reflected nextval() default removed before the option is set. The previous advice raised CompileError.
  • The name is not schema-qualified, and the CompileError check applies per table.

Tests

Two new end-to-end tests fail on main and pass here. Full suite:

  • DuckDB 1.5.6, SQLAlchemy 2.0.52: 923 passed, 10 skipped
  • DuckDB 2.0.0, SQLAlchemy 2.1.9: 923 passed, 10 skipped
  • DuckDB 1.3.0, SQLAlchemy 2.0.0: 916 passed, 17 skipped

Routing raw DBAPI cursor calls through the connection wrapper also changed begin(), commit() and rollback(), which stopped opening a transaction under AUTOCOMMIT, and buffered an open result on a bare attribute lookup. Leave the transaction calls to DuckDB and buffer only when a routed method is called. Correct the duckdb_sequence_name advice for reflected tables.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T16:16:09.844838Z 56f6c95 PR opened
ℹ️ 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.

@leonardovida
leonardovida merged commit d34e018 into main Nov 17, 2026
32 checks passed
@leonardovida
leonardovida deleted the fix/cursor-raw-call-routing branch November 17, 2026 16:18
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