|
| 1 | +import gridData from '../../data/database-grid.json'; |
| 2 | + |
| 3 | +/** |
| 4 | + * Every engine-count claim on the site, derived from one dataset. |
| 5 | + * |
| 6 | + * The figure was written out as "25" in eight places — the hero, the grid |
| 7 | + * headline and its lede, the spec strip, the licence block, an FAQ answer, the |
| 8 | + * JSON-LD publisher blurb and two fields on Home.tsx — plus roughly thirty more |
| 9 | + * across `comparisons.json`. Three of those were stale in a way nobody could |
| 10 | + * see from the source: the app had reached 28 registered types while the site |
| 11 | + * still said 25 and the docs said 27. |
| 12 | + * |
| 13 | + * The trap in the old copy was that "25" was not arbitrary. It counted distinct |
| 14 | + * `driverGroup` values in `database-grid.json`, which is a *driver* count, while |
| 15 | + * the headline above it promised *databases*. Two different quantities wearing |
| 16 | + * the same number, so raising one silently broke the other. |
| 17 | + * |
| 18 | + * These derive from the grid instead. The grid is what a reader can actually |
| 19 | + * count on the page, so a claim that disagrees with it is a claim the page |
| 20 | + * disproves two rows down. `EngineCountTest` pins the derived value, so adding |
| 21 | + * a tile is a deliberate change to the marketing copy rather than a side effect. |
| 22 | + */ |
| 23 | +interface DatabaseTile { |
| 24 | + distribution: 'builtin' | 'plugin'; |
| 25 | +} |
| 26 | + |
| 27 | +const tiles = gridData as DatabaseTile[]; |
| 28 | + |
| 29 | +/** |
| 30 | + * Engines a connection can be opened against — the app's registered type ids, |
| 31 | + * one grid tile each. |
| 32 | + * |
| 33 | + * Turso was the open question and is now counted. It had its own `DatabaseType` |
| 34 | + * and its own `/turso-client` page but no snapshot, resolving through |
| 35 | + * `reverseTypeIndex["Turso"] = "libSQL"`, so it shared a `libSQL / Turso` tile |
| 36 | + * and the app returned 28. It now follows the ScyllaDB precedent — an alias that |
| 37 | + * also carries an entry of its own — so libSQL and Turso are two tiles over one |
| 38 | + * driver, exactly as Cassandra and ScyllaDB are. |
| 39 | + */ |
| 40 | +export const ENGINE_COUNT: number = tiles.length; |
| 41 | + |
| 42 | +/** Drivers compiled into the app, ready on first launch. */ |
| 43 | +export const BUNDLED_ENGINE_COUNT: number = tiles.filter((tile) => tile.distribution === 'builtin').length; |
| 44 | + |
| 45 | +/** The rest, fetched and signature-verified the first time one is picked. */ |
| 46 | +export const ON_DEMAND_ENGINE_COUNT: number = ENGINE_COUNT - BUNDLED_ENGINE_COUNT; |
| 47 | + |
| 48 | +/** |
| 49 | + * Driver plugin targets in the app repository, which is fewer than the engines |
| 50 | + * they serve: PostgreSQL also drives Redshift, CockroachDB and PGlite, Cassandra |
| 51 | + * drives ScyllaDB, and libSQL drives Turso. |
| 52 | + * |
| 53 | + * Nothing in this repository can derive this — it is a count of build targets in |
| 54 | + * an application this site cannot see — so it is a literal, and the only one. |
| 55 | + */ |
| 56 | +export const DRIVER_PLUGIN_COUNT = 23; |
0 commit comments