Skip to content

docs(postgres): cite code by name, not by line - #636

Merged
cevheri merged 1 commit into
libredb:mainfrom
7487:docs/postgres-citations-by-name
Sep 7, 2026
Merged

docs(postgres): cite code by name, not by line#636
cevheri merged 1 commit into
libredb:mainfrom
7487:docs/postgres-citations-by-name

Conversation

@7487

@7487 7487 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description

docs/providers/postgres.md cited code by line number in 17 places on today's main (the issue counted 18; the factory.ts:62 one already went with #629). Every checkable one was stale, and not by a little: postgres.ts has grown by roughly 900 lines above the cited methods, so getCapabilities() cited :250 is declared at :955, validate() cited :264 at :1005, query() cited :378 at :1177, runMaintenance() cited :762 at :1696. The three sql-base.ts methods missed by -16, +3 and +3, and analyzeQuery() cited query-limiter.ts:88 is declared at :177.

Each citation now names the declaration and links the file without a coordinate, the shape mssql.md, mysql.md, oracle.md and mongodb.md already use. The two range citations (:86–177, :148–150) pointed into the schema SQL, which has since been hoisted to module scope, so they now name what they meant: the CTE_*_INFO consts for the AS MATERIALIZED claim, and CTE_FK_INFO for the two-column constraint_column_usage join. No sentence changed meaning.

The doc joins NAMED_CITATIONS in tests/unit/provider-docs-monitoring-citations.test.ts, with postgres.ts as its source and the nine methods that now stand where a line number used to. The list's two tests then assert the doc carries no .ts:<line> anywhere and that every name it cites is really declared.


Type of Change

  • Documentation update
  • Test addition or update

Related Issue

Fixes #589


Changes Made

  • docs/providers/postgres.md: 17 citations rewritten, no product code
  • tests/unit/provider-docs-monitoring-citations.test.ts: one NAMED_CITATIONS entry

Testing

  • I have tested this locally
  • I have added/updated tests
  • All existing tests pass

Measured on this branch:

pass fail
bun test tests/unit/provider-docs-monitoring-citations.test.ts 29 0
same, with the doc change reverted and the list entry kept 28 1 (postgres.md cites no line number anywhere)

grep -oE '\.ts:[0-9]+' docs/providers/postgres.md returns nothing. bun run format, bun run lint (0 errors), bun run typecheck and bun run knip are clean. bun run test: the hooks, security, evals and components layers all pass; the unit/api/integration layer passes except the chart tests without helm on PATH (#570), sqlite-driver under Bun 1.3.11 (no node:sqlite; the repo pins 1.4.2) and packaging-standalone-zip without a standalone build. None of those touch these two files.

Test Environment

  • LibreDB Studio Version: main @ f96d63b
  • OS: macOS
  • Node.js/Bun Version: Bun 1.3.11

Checklist

  • My code follows the project's code style guidelines
  • I have performed a self-review of my code
  • I have updated the documentation accordingly
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

postgres.md pinned 17 citations to line numbers in postgres.ts, sql-base.ts
and query-limiter.ts, and every checkable one was stale: validate() cited
:264 is declared at :1005, getCapabilities() cited :250 at :955, and the
three sql-base.ts methods missed by -16, +3 and +3. Each now names the
declaration and links the file the way mssql.md, mysql.md, oracle.md and
mongodb.md already do; the two range citations name the CTE_*_INFO consts
the ranges used to cover.

The doc joins NAMED_CITATIONS in the guard, so it can carry no `.ts:<line>`
and every method it names must really be declared in postgres.ts. Reverting
the doc alone fails 1 of 29.

Fixes libredb#589

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cevheri
cevheri merged commit a7212a8 into libredb:main Sep 7, 2026
22 checks passed
@cevheri

cevheri commented Sep 7, 2026

Copy link
Copy Markdown
Member

Thanks @7487 great work

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.

docs/providers/postgres.md: replace 18 stale line-number citations with named citations

2 participants