Skip to content

[finding] four packages/cli sites cite driver-sql's lookup arm for "a platform id is 26 characters" — the platform mints 16, and stores a supplied id at any width #16114

Description

@zhuangjianguo

Found while implementing #15522 (driver-sql's lookup arm), deliberately not fixed there — a different package, so a different verification surface. Unassigned, bare, for triage.

The claim, and why it is not this platform's

packages/drivers/driver-sql/src/sql-driver.ts's case 'lookup': case 'user': arm carried the sentence "a platform id is 26 characters", spelling out a ULID literal 01JQ8XKZ9M4N7P2R5T6V8W0Y3B. Measured on origin/main 64011dd3f while closing #15522:

  • DEFAULT_ID_LENGTH is 16, and git log -p --follow over the whole life of that file yields exactly one +const DEFAULT_ID_LENGTH line and no - line — it has never been anything but 16.
  • No ULID is minted anywhere in this repo. git grep -rni ulid excluding the lockfile returns 0; the positive control nanoid on the same instrument returns 50.
  • Empirically, driving the real SqlDriver against SQLite: a write supplying no id gets a 16-character nanoid; a write that supplies an id has it stored verbatim at whatever width the caller chose (10-, 17- and 18-character ids all landed unaltered).
  • Three drivers agree independently — driver-sql, driver-mongodb, driver-turso each spell DEFAULT_ID_LENGTH = 16; driver-memory mints a different shape entirely. Ids are driver-owned; nothing above the driver mints one.

⇒ An id's width is not a fixed number at all, and 26 is not among the numbers this platform produces.

The four sites (locate by TEXT — line numbers drift)

All four cite the driver arm by name as their authority, which is what makes them worth a card rather than a typo:

file anchor text
packages/cli/src/commands/generate.ts id is 26 characters (`createColumn`'s lookup arm says so and
packages/cli/src/commands/generate.ts this card's five rows — a platform id is 26 characters
packages/cli/src/commands/generate-field-type-vocabulary.pin.test.ts A platform id is 26 characters (driver-sql spells one out in its lookup arm),
packages/cli/src/commands/generate-multiple-json-column.pin.test.ts platform id is 26 characters and Postgres refuses one in a + backtick-uuid-backtick + column.

The third is a failure-message string inside expect(value, message), not an asserted value; the fourth is a plain comment. Neither is load-bearing for pass/fail, and the first two are doc comments — so this is expected to be a comment/message-text-only change.

What is NOT claimed here

Nothing landed on a false premise. Every one of these four passages concludes that a reference column must be table.string(...) / VARCHAR(255) rather than table.uuid, and that conclusion is unchanged: Postgres refuses a 16-character nanoid in a uuid column with 22P02 exactly as it refuses a ULID. Only the cited number and the ULID literal are wrong.

Not a request to change what anything mints. DEFAULT_ID_LENGTH stays 16.

Also spread, and out of reach

Two CHANGELOG entries carry the same claim and are historical records, ⛔ not to be edited:

  • packages/cli/CHANGELOG.mdThis was the one hard failure: a platform id is 26 characters, and Postgres
  • packages/platform-objects/CHANGELOG.mdA minted platform id is 26 characters, so — note this one says minted, which is the strongest form of the false claim.

Why it earns a card

#15522 filed the origin sentence on the argument that "an authority sentence contradicted by its own file's constant is a citation waiting to be relied on again." It already had been — four times, in a second package, each naming the driver arm as its source. With the origin now corrected, these four are the surviving copies and the citation chain points at text that no longer exists.

Refs: #15522 · #14828 · #11431.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions