Skip to content

Bridge SQL connection access between R and Python - #186

Open
t-kalinowski wants to merge 11 commits into
mainfrom
feat/shared-sql-connection
Open

t-kalinowski wants to merge 11 commits into
mainfrom
feat/shared-sql-connection

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Allow .console$sql_connection() and _console.sql_connection() to retrieve and select connections owned by either runtime through reticulate, so using the other runtime's helper no longer fails because of ownership. R receives a proxy for Python connections; Python receives an opaque R handle it can pass to R functions. R remains the default SQL owner when available.

Connections keep their native APIs and ownership. Getters preserve unread results; selecting a connection discards them without closing the connection or committing its transaction. Reset restores the managed catalog, and result retrieval still uses the owning runtime.

Internally, a private reticulate callback keeps SQL access independent of a Python variable named r. Update the documentation and model guidance, with public regressions for connection identity, selection, reset, result lifetime, and transactions.

Validated on macOS with 106 public transcript cases (163 executions), including named-session isolation and structured SQL errors, plus scripts/format, git diff --check, and scripts/check. Windows and Linux were not run locally.

Apply the existing test-only DuckDB snapshot to direct and MXC SQL
scenarios. Assert the selected version before the long query so cold
caches cannot silently introduce the known Arrow cancellation limitation.
Preserve production defaults, interruption deadlines, and exact results.
Queue stdin while the replacement cell is held at its checkpoint, then
release it and collect the complete result. Preserve the exact output
and idle-state assertions without assuming one response completes the cell.
Keep the required completion marker when a control-and-cell response is
split across polls. Exercise the split with a gated native R startup cell
and select the same contract in related restart continuations.
Refresh generated SQL tracebacks and tool guidance for the combined sources.
@t-kalinowski
t-kalinowski marked this pull request as ready for review October 31, 2026 21:20
@t-kalinowski

Copy link
Copy Markdown
Member Author

No findings found by gpt-6-astra with reasoning effort max

Reviewed commit: 9a79e4d08cfaa4f5648bb1c4d1626b621587024c.

Regenerate the companion transcript after SQL connection bridging shifted
the embedded Python evaluator by eleven lines. Preserve complete diagnostics.
@t-kalinowski

Copy link
Copy Markdown
Member Author

No findings found by gpt-6-astra with reasoning effort max

Reviewed commit: 4c35530570c1aacdf888bc12fb05c461d4018a0a.

This branch has not been deployed

No deployments
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