feat(pkg-r): support sqlite engine in PinSource#251
Open
gadenbuie wants to merge 2 commits into
Open
Conversation
PinSource gains an engine argument mirroring DataFrameSource. Data-frame pins (and any pin loaded under the sqlite engine) now share DataFrameSource's connection path via the new new_dataframe_connection() helper, so the SQL flavor is resolved consistently. The efficient direct DuckDB file read is kept for parquet/csv/json pins under the duckdb engine; requesting sqlite for those pins falls back to pin_read() with a warning.
The PinSource feature (#246) was added without a NEWS/changelog entry.
Contributor
Author
|
Python E2E failures are unrelated, this PR only touches R code |
cpsievert
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PinSourcepreviously always used DuckDB, even for pins that deserialize to a plain data frame. SinceduckdbandRSQLiteare both optional (Suggests) in the R package, a user who installed only RSQLite could useDataFrameSourcebut notPinSource. This PR alignsPinSourcewithDataFrameSource's engine handling.Key changes:
DataFrameSource's inline connection setup into a shared internal helper,new_dataframe_connection(df, table_name, engine), which creates an in-memory connection, registers the data frame, and applies the DuckDB security lockdown.DataFrameSource$initialize()now calls it.PinSource$new()gains anengineargument (defaultgetOption("querychat.DataFrameSource.engine", NULL), resolved via the sameget_default_dataframe_engine()asDataFrameSource). Data-frame pins now shareDataFrameSource's code path, so the SQL flavor reported by the inheritedget_db_type()is resolved consistently.duckdbengine. Requestingengine = "sqlite"for those pin types falls back topin_read()with a warning that DuckDB reads them more efficiently.duckdbis no longer unconditionally required byPinSource— it is only needed when actually used.While here, this PR also backfills a changelog entry for the original
PinSourcefeature (#246), which was merged without one, in bothNEWS.mdand the PythonCHANGELOG.md. The Python side is otherwise intentionally unchanged:duckdbis a core dependency there andDataFrameSource/PinSourceare DuckDB-only by design, so no equivalent gap exists.Verification
New tests cover the SQLite data-frame path and the file-type fallback warning in
tests/testthat/test-PinSource.R.