Skip to content

docs: publish the compatibility matrix as machine-readable data - #146

Merged
singhpratech merged 2 commits into
mainfrom
docs/compatibility-json
Sep 24, 2026
Merged

singhpratech merged 2 commits into
mainfrom
docs/compatibility-json

Conversation

@singhpratech

Copy link
Copy Markdown
Owner

Adds docs/compatibility.json: for each of the 53 entries, the per-OS result with whatever the cell says beside the verdict, plus the driver quirks the harness actually applies.

The reasoning: verified per-database, per-driver, per-OS capability data for ODBC drivers does not exist anywhere else, and a table only a human can read cannot be consumed by anything else. This makes the project useful to people who never install it.

Generated, never edited

scripts/gen_compatibility_json.py reads docs/COMPATIBILITY.md and the DBS dict in tests/compat/test_matrix.py, so the quirks come from the code that runs rather than from prose. Connection strings and fixture plumbing are excluded — local detail, and a published connection string invites copy-paste.

Two things it refuses to guess, both learned while writing it

The two tables are in different orders. Joining them by position put QuestDB's results under Microsoft Access's name. Falling back to matching the entry id against the display name looked safe and was worse: it silently paired db2 with "Db2 for i" and ibmi with "IBM Informix", and because each had exactly one candidate, an "exactly one match" check passed both. The mapping is now written out for all 53 entries and asserted to be a bijection, so a row added to one table and not the other fails the build instead of producing plausible nonsense.

The per-OS totals are counted and then checked against the 53 / 45 / 48 that README.md, docs/index.md and the landing page quote. The generator exits rather than emit a figure that disagrees with its source. It also forced me to fix my own result parser: an early version counted macOS at 33 because it only understood PASS (detail) and not PASS (detail) — prose or PASS with <driver> …, while treating driver unavailable: … and server not runnable here: … as their own statuses rather than failures. With that right, the count matches the published figures exactly.

Drift protection

CI regenerates the file and diffs it, alongside the existing version-agreement and rust/csrc checks. So the data cannot fall behind the table, and a matrix change that would alter the published counts fails the build rather than going out quietly.

docs/COMPATIBILITY.md and the README both point at it.

docs/compatibility.json carries, for each of the 53 entries, the per-OS result
with whatever the cell says beside the verdict, and the quirks the harness
actually applies to that database. Nobody else publishes verified
per-database/per-driver/per-OS capability data, and a table only a human can
read cannot be consumed by anything else.

Generated by scripts/gen_compatibility_json.py from docs/COMPATIBILITY.md and
the DBS dict in tests/compat/test_matrix.py, so the quirks come from the code
that runs rather than from prose. Connection strings and fixture plumbing are
left out: they are local detail, and publishing a connection string invites
copy-paste.

Two things the generator refuses to guess, both learned the hard way while
writing it:

- The two tables in COMPATIBILITY.md are in different orders, so joining them
  by position put QuestDB's results under Microsoft Access's name. Matching the
  entry id against the display name looked safer but silently paired "db2" with
  "Db2 for i" and "ibmi" with "IBM Informix" - each had exactly one match, so an
  "exactly one candidate" check passed both. The mapping is now written out for
  all 53 entries and asserted to be a bijection, so a row added to one table and
  not the other fails the build.

- The per-OS totals are counted, then checked against the 53/45/48 the README
  and the site quote. The script exits rather than emit a number that disagrees
  with its source, which is the failure this project has had before in
  hand-written copy.

CI regenerates the file and diffs it, so the published data cannot drift from
the table.
Two things CI caught that local runs could not.

Importing tests/compat/test_matrix.py pulls in pyarrow, which the
version-agreement job does not have and should not need - it is the cheap job
that runs plain python3 scripts. The DBS dict is now read with ast instead, so
nothing is imported and no test module runs for its data. Values that are not
literals are kept as their source text, which also reads better in the output:
"pa.bool_(): pa.int8()" rather than "DataType(bool)", and "str.upper" rather
than "<method 'upper' of 'str' objects>".

The generated file also carried a generation date and the short commit, which
made it different on every run. CI regenerates and diffs it, so the output has
to be reproducible: both fields are gone, and git already records when the file
changed and at what commit.

Verified: two consecutive runs produce identical bytes, and the script runs on a
python3 with no pyarrow installed.
@singhpratech
singhpratech merged commit b37f1a0 into main Sep 24, 2026
6 checks passed
@singhpratech
singhpratech deleted the docs/compatibility-json branch September 24, 2026 05:42
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