Skip to content

docs: State the goals and non-goals - #607

Merged
krlmlr merged 16 commits into
mainfrom
claude/readme-goals
Nov 29, 2026
Merged

krlmlr merged 16 commits into
mainfrom
claude/readme-goals

Conversation

@krlmlr

@krlmlr krlmlr commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Adds a "Goals and non-goals" section to README.md, and fixes the doubled "the" in the install snippet ("Or the the development version from GitHub"), folded in from #608.

This package has no README.Rmd yet, so README.md is the source and was edited directly. #609, stacked on this PR, derives README.md from a new README.Rmd.

Evidence for each claim, checked against main as of 4f3eca5:

  • Implements the DBI specification and runs DBItest: tests/testthat/test-DBItest.R with the context in tests/testthat/helper-DBItest.R (dbitest_version = "1.9.0").
  • Parameterised queries through dbSendQuery() and dbBind(): both are exported methods; dbBindArrow() exists too.
  • "map PostgreSQL types to the R types that fit them best": deliberately a best-fit claim, not a lossless one. src/PqResultImpl.cpp maps NUMERIC/DECIMAL and MONEY to double, and INTERVAL and UUID to character. What the code does support is bit64::integer64 for BIGINT by default (the bigint argument of dbConnect() also offers integer, numeric and character), blob for bytea, and a separate datetime-with-time-zone type for timestamptz.
  • PostgreSQL features without a DBI generic: postgresWaitForNotify(), postgresImportLargeObject() and Redshift() are exported.
  • Redshift with adjusted methods: RedshiftConnection changes dbQuoteString(), dbWriteTable(), dbListObjects() and the copy default in R/tables.R.
  • Does not define the interface, does not translate R code into SQL: DBI is an Imports; the API takes SQL strings, with no query builder in NAMESPACE.
  • Does not bundle a client library: SystemRequirements: libpq >= 9.0, and no libpq source in the package. The bullet does not say "the build relies on the system libpq": on Windows, src/Makevars.win uses the Rtools libpq when present and otherwise tools/winlibs.R downloads a prebuilt one; on macOS, configure falls back to autobrew when the local libpq is older than 15 or lacks SSL. Hence "downloads a prebuilt binary where that one is missing or unsuitable".
  • Does not reproduce the full driver/connection/result generality: the README's own "Design notes": "a driver has no real state, for PostgreSQL each connection can only have one result set … the driver class is just a dummy class with no contents." The bullet does not repeat the Design notes' claim that connection and result share one external pointer, which the code contradicts: each PqResult has its own ptr from result_create() (R/dbSendQuery_PqConnection.R), and the C++ connection only tracks its current result (pCurrentResult_ in src/DbConnection.cpp), cleaning it up, and cancelling it if incomplete, when a new query starts.
  • Not the whole specification on Redshift, where BLOBs are not supported: NEWS.md 1.4.0 records "BLOBs are not supported on Redshift", and the commented-out Redshift context in tests/testthat/helper-DBItest.R carries omit_blob_tests = TRUE. The bullet stops there: 1.4.0 also reported "limitations with enumerating temporary and persistent tables", which 1.4.3 supersedes ("Temporary tables are now discovered correctly for Redshift() connections, all DBItest tests pass (Allow to find table in temporary schema for Redshift #358)"). The code still carries Redshift-specific table listing (R/tables.R, R/dbListObjects_PqConnection_ANY.R), which is how 1.4.3 fixed it, so the README does not call table listing limited. The Redshift DBItest context is not run in CI, so this is unchecked against a live cluster.

New text uses * bullets like the list above it, and US spelling ("behavior", as elsewhere in the package), except "parameterised", which matches the existing README line above it.

The DBI specification is linked as https://dbi.r-dbi.org/articles/spec.html, since pkgdown on GitHub Pages does not append .html.

Bottom of the stack #607 → #609.

Accepted limitations. The existing "Design notes" section of README.md makes a false claim about a shared external pointer; that predates this PR and is tracked in #670.

Sessions: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m (original author), https://claude.ai/code/session_01Hr1rd6e5NcxC9GSrNJDokc (finalizing).


Generated by Claude Code

@krlmlr
krlmlr force-pushed the claude/readme-goals branch from 0f00825 to 0b44d78 Compare September 13, 2026 14:26
@krlmlr
krlmlr force-pushed the claude/readme-goals branch from 0b44d78 to e5bc052 Compare September 13, 2026 14:29
@krlmlr
krlmlr force-pushed the claude/readme-goals branch 3 times, most recently from 44da833 to 855f9e9 Compare September 13, 2026 16:31
@krlmlr
krlmlr force-pushed the claude/readme-goals branch from 855f9e9 to cc42687 Compare September 13, 2026 16:59
@krlmlr
krlmlr force-pushed the claude/readme-goals branch from cc42687 to 0c10e62 Compare September 13, 2026 18:26
@krlmlr
krlmlr force-pushed the claude/readme-goals branch from 0c10e62 to 447b399 Compare September 13, 2026 18:38
@krlmlr
krlmlr added this pull request to stack #611 September 13, 2026 21:05
@krlmlr
krlmlr force-pushed the claude/readme-goals branch 2 times, most recently from 9ad9a43 to fa79a6f Compare September 13, 2026 21:42
krlmlr and others added 9 commits September 14, 2026 07:27
One of the items `usethis::use_tidy_upkeep_issue()` prescribes for 2023.
`pak::pak()` resolves system requirements and installs binaries where they exist,
so it does not need a compiler for pure-R dependencies the way `install_github()` does.

The `# install.packages("pak")` comment is kept, matching what the packages in this fleet that already use pak do.
Both usethis and devtools import pak, so most readers already have it,
but a reader with neither of those installed still needs the line.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Closes #599.

The badge image was pinned to `branch/master`, which has not existed since the rename to `main`.
Codecov kept serving that branch's last recorded figure while `main` moved on,
so the image disagreed with the link beside it, which already pointed at `main`.

The branch is dropped from the image URL rather than corrected to `main`.
A branch-pinned badge goes stale silently the next time a branch is renamed, which is exactly what happened here;
without one, codecov reports the default branch and the badge follows a rename on its own.

The link becomes `app.codecov.io/gh/r-dbi/RPostgres/tree/main`:
the `app.` host is the UI (the bare host serves the badge image),
`/gh/` is the canonical short form,
and `/tree/main` is the branch view rather than the `?branch=` query that redirects to it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Reformatting only, no wording changes: prose in README.md, the
vignette and the roxygen and inline comments under R/ now breaks at
sentence and clause boundaries rather than wrapping to a fixed width.

The payoff is sentence-level diffs. A reworded sentence touches one
line instead of reflowing the paragraph around it, so review sees the
change and not the rewrap.

man/*.Rd is regenerated because roxygen2 passes source line breaks
through to the .Rd. The rendered help is byte-identical -- checked with
tools::Rd2txt() over every topic -- as is the rendered README.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
A sentence that spans more than one line now starts at the beginning of
a line, and so does the sentence after it. Line breaks only, no wording
changes.

Where two sentences are separated by two spaces, the pair stays on one
long line: roxygen2 strips leading and trailing whitespace from
continuation lines, so a break at that gap would drop a space from the
rendered help.

man/*.Rd is regenerated because roxygen2 passes source line breaks
through to the .Rd. The rendered help is byte-identical -- checked with
tools::Rd2txt() over every topic.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Inside a roxygen block the first line of a paragraph, and every tag line,
keeps one space after `#'`; every continuation line of that paragraph now
has two. The paragraph structure of the source becomes visible without
reading ahead, and in packages that do not enable roxygen2 markdown the
extra space is what carries a sentence gap across a line break.

RPostgres enables markdown (`Roxygen: list(markdown = TRUE)`), and commonmark
strips leading whitespace from a paragraph's continuation lines, so here
the indent reaches neither `man/*.Rd` nor the rendered help. Nothing is
regenerated: roxygen2 writes no file, and `tools::Rd2txt()` is unchanged
for every topic.

That also means the one long line this pass created cannot come apart
again. `R/dbConnect_PqDriver.R` keeps the sentence pair that the
previous commit joined on a single line, because under markdown no
leading-space, trailing-space or hard-break form survives into the
`.Rd`, so breaking there would drop a space from the rendered help.

The generated `R/cpp11.R` is left untouched.

Reformatting only, no wording changes: the words either side of the diff
are identical once comment markers and whitespace are collapsed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
The two-space continuation indent never reached the `.Rd`. RPostgres sets
`Roxygen: list(markdown = TRUE)`, and commonmark strips the leading
whitespace of a continuation line before roxygen2 writes the topic, so the
indent changed no rendered output -- `man/` was byte-identical with it and
without it.

The sentence gap it was meant to carry now comes from roxygen2 itself
(krlmlr/roxygen2#8), which indents the line break after a sentence at the
point where the break is emitted. The source-level indent is redundant, so
it comes out.

This is `git revert` of the indent commit, not a substitution: that pass also
normalised pre-existing three-space tag continuations down to two, and the
revert puts them back at three.

The long joined lines the sembr pass created stay as they are. Undoing those
is a separate decision, and the roxygen2 fix is what will eventually let them
come apart.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
The long joined lines existed to protect a sentence gap:
two spaces after a sentence period are content, Rd2txt() renders them literally, and a line break there drops one of them.
Joining the sentences onto one line was the only way to keep the gap.

The joins come out, so every sentence starts its own line again.

Reformatting only, no wording changes.

man/ is left to CI, which regenerates it from these sources.

A line break which follows the end of a sentence currently renders as one space rather than two.
Restoring that gap needs a patched roxygen2, which is a separate decision and a separate pull request,
so it is deliberately not part of this change.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
Scope drawn from the README's own opening and its "Design notes" section
("This turns out to be too general: a driver has no real state, for PostgreSQL
each connection can only have one result set ... the driver class is just a
dummy class with no contents"), the DESCRIPTION (Imports DBI, bit64, blob, hms,
lubridate; SystemRequirements names libpq >= 9.0), the exported
PostgreSQL-specific helpers in NAMESPACE (postgresWaitForNotify(),
postgresImportLargeObject(), Redshift()), and tests/testthat/test-DBItest.R,
which runs DBItest::test_all().

The type-mapping goal claims a best fit rather than a lossless one.
src/PqResultImpl.cpp maps NUMERIC and MONEY to double, and INTERVAL and UUID to character,
so "without losing information" would not hold.

The Redshift non-goal names BLOBs only, which tests/testthat/helper-DBItest.R
still records as `omit_blob_tests = TRUE` in its Redshift context.
NEWS.md 1.4.0 also reported limitations enumerating temporary and persistent tables,
but 1.4.3 supersedes that entry: "Temporary tables are now discovered correctly
for `Redshift()` connections, all DBItest tests pass".

The "does not bundle a client library" non-goal says that no libpq source ships with the package,
rather than that the build relies on the system libpq.
The latter holds on Unix only: tools/winlibs.R downloads a prebuilt libpq on Windows,
and configure falls back to autobrew on macOS.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
@krlmlr
krlmlr force-pushed the claude/readme-goals branch from fa79a6f to 3c59035 Compare September 14, 2026 05:27
Base automatically changed from claude/sembr to main September 14, 2026 14:37
Scope drawn from the README's own opening and its "Design notes" section
("This turns out to be too general: a driver has no real state, for PostgreSQL
each connection can only have one result set ... the driver class is just a
dummy class with no contents"), the DESCRIPTION (Imports DBI, bit64, blob, hms,
lubridate; SystemRequirements names libpq >= 9.0), the exported
PostgreSQL-specific helpers in NAMESPACE (postgresWaitForNotify(),
postgresImportLargeObject(), Redshift()), and tests/testthat/test-DBItest.R,
which runs DBItest::test_all().

The type-mapping goal claims a best fit rather than a lossless one.
src/PqResultImpl.cpp maps NUMERIC and MONEY to double, and INTERVAL and UUID to character,
so "without losing information" would not hold.

The Redshift non-goal names BLOBs only, which tests/testthat/helper-DBItest.R
still records as `omit_blob_tests = TRUE` in its Redshift context.
NEWS.md 1.4.0 also reported limitations enumerating temporary and persistent tables,
but 1.4.3 supersedes that entry: "Temporary tables are now discovered correctly
for `Redshift()` connections, all DBItest tests pass".

The "does not bundle a client library" non-goal says that no libpq source ships with the package,
rather than that the build relies on the system libpq.
The latter holds on Unix only: tools/winlibs.R downloads a prebuilt libpq on Windows,
and configure falls back to autobrew on macOS.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m
@krlmlr
krlmlr force-pushed the claude/readme-goals branch from 3c59035 to 12b1284 Compare September 14, 2026 14:37
krlmlr pushed a commit that referenced this pull request Nov 29, 2026
Carries the fix from the README.md source in #607 into the files rendered from README.Rmd.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6e5NcxC9GSrNJDokc
krlmlr pushed a commit that referenced this pull request Nov 29, 2026
Carries the two README.md wording edits from #607 into README.Rmd
and re-renders README.md and index.md from it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6e5NcxC9GSrNJDokc
Connection and result do not share one external pointer:
each result has its own, and a new query cancels the open one.
Also fix comma splices, say that integer64 is only the default for bigint,
match the bullet style of the list above, and break the longer lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6e5NcxC9GSrNJDokc
krlmlr pushed a commit that referenced this pull request Nov 29, 2026
Carries the revised "Goals and non-goals" section from #607 into README.Rmd
and re-renders README.md and index.md from it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6e5NcxC9GSrNJDokc

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Accepted limitations

These remain after two rounds of clean review (round 2 found nothing above Low).

  • README.md#L50: "a new query on a connection cancels any result set still open on it" is slightly broad: a result that has already completed is closed and becomes unusable, but nothing is cancelled on the server. The wording matches the package's own warning ("Closing open result set, cancelling previous query"). Relevance: low. Confidence: high.
  • README.md#L32 and #L46: two lines are about 120 characters; they stay within the 140-column ceiling for semantic line breaks, and splitting them would add lines without a meaning boundary that reads better. Relevance: low. Confidence: high.
  • Pre-existing on main, not introduced here: the "Design notes" section says connection and result share one external pointer, which is false; tracked in README "Design notes" says connection and result share one external pointer #670.

Generated by Claude Code

@krlmlr
krlmlr merged commit 68f37c5 into main Nov 29, 2026
7 checks passed
@krlmlr
krlmlr deleted the claude/readme-goals branch November 29, 2026 19:04
krlmlr added a commit that referenced this pull request Nov 29, 2026
* docs: Derive `README.md` from a `README.Rmd`

The hand-written `README.md` keeps the package out of the shared rendering pipeline,
so this adds a `README.Rmd` copied from it verbatim,
prefixed with the `cynkratemplate::readme_document` front matter and the canonical generated-file comment.

Rendering with `cynkratemplate::render_readme()` also writes `index.md` for pkgdown,
which is the `README.md` without the code-of-conduct footer.
Both `README.Rmd` and `index.md` are added to `.Rbuildignore` so neither ships in the tarball.

The rendered `README.md` differs from the hand-written one only in pandoc's gfm normalisations:
the generated-file comment, `*` bullets written as `-`, ` ```R ` written as ` ``` r `,
blank lines inserted around headings and `<!-- badges: start -->`, trailing whitespace stripped,
and `---` written as a full-width row of hyphens.
No word, URL, or code-block content changes.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m

* docs: Derive `README.md` from a `README.Rmd`

The hand-written `README.md` keeps the package out of the shared rendering pipeline,
so this adds a `README.Rmd` copied from it verbatim,
prefixed with the `cynkratemplate::readme_document` front matter and the canonical generated-file comment.

Rendering with `cynkratemplate::render_readme()` also writes `index.md` for pkgdown,
which is the `README.md` without the code-of-conduct footer.
Both `README.Rmd` and `index.md` are added to `.Rbuildignore` so neither ships in the tarball.

The rendered `README.md` differs from the hand-written one only in pandoc's gfm normalisations:
the generated-file comment, `*` bullets written as `-`, ` ```R ` written as ` ``` r `,
blank lines inserted around headings and `<!-- badges: start -->`, trailing whitespace stripped,
and `---` written as a full-width row of hyphens.
No word, URL, or code-block content changes.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m

* docs: Render README.md with the autolinker

The format from cynkratemplate#135 now links inline code in prose to its reference page,
and this branch was rendered before that landed,
so the committed README.md no longer matched a fresh render.
With the README rendered in CI by default, the first run would have committed the links itself;
this commits exactly what that run produces, so the pull request stays a faithful render.

Only README.md changes: the links are added to prose and nothing else moves.
index.md is untouched, because pkgdown links the front page itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WWhverMTZZKgEpUuTK117m

* docs: Fix the doubled "the" in README.Rmd and index.md

Carries the fix from the README.md source in #607 into the files rendered from README.Rmd.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd6e5NcxC9GSrNJDokc

---------

Co-authored-by: Claude <[email protected]>
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.

2 participants