From 8b58aa7304c5e921ae43d995945cf819ed5435c5 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 25 Aug 2026 06:04:23 +0000 Subject: [PATCH] fix(objectql): sync IntrospectedColumn.isUnique consumer docblock to the producer's PRIMARY KEY exclusion (#11826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The consumer-side copy of `IntrospectedColumn.isUnique` in packages/objectql/src/util.ts declares it "must not drift" from the producer's contract sentence (`SqlDriver`'s `IntrospectedColumn.isUnique` in @objectstack/driver-sql). #11654 added a PRIMARY KEY exclusion clause to the producer's sentence; this copy had not been synced. Prose only — introspectedSchemaToObjects/convertIntrospectedSchemaToObjects is unchanged, and the package's own test fixture already modeled a key column as { primaryKey: true } with no isUnique, so the data already agreed with the new convention. Checked the docblock's second "must not drift" copy (IntrospectedForeignKey.referencedSchema) against its producer too — not drifted, no action needed. skip-changeset: no behaviour, no export. Claude-Session: https://claude.ai/code/session_01W6HFzyH98W1YaQXhJUJt6o Co-authored-by: Claude --- packages/objectql/src/util.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/objectql/src/util.ts b/packages/objectql/src/util.ts index b769d25d23..9b0e7d1109 100644 --- a/packages/objectql/src/util.ts +++ b/packages/objectql/src/util.ts @@ -42,6 +42,17 @@ export interface IntrospectedColumn extends SpecIntrospectedColumn { * — is the contract sentence; this is the consumer-side copy of the same * key and must not drift from it. An absent flag on a composite member * means "not single-column unique", never "no constraint". + * + * A PRIMARY KEY is NOT a unique constraint to this flag (#11654), on any + * dialect and for any key type. `isUnique` means a *declared* + * single-column UNIQUE constraint; key membership has a lossless face of + * its own ({@link IntrospectedTable.primaryKeys} and `primaryKey` below), + * so excluding keys keeps the two flags non-overlapping and drops no + * fact. Note this is a statement about what KIND of constraint the flag + * reports, never a claim that a key column admits duplicates. A key + * column that separately carries its own single-column unique constraint + * is still flagged — the constraint is what is being reported, not the + * column. */ isUnique?: boolean; /**