Skip to content

Commit 3b9da58

Browse files
os-warrenclaude
andauthored
fix(objectql): sync IntrospectedColumn.isUnique consumer docblock to the producer's PRIMARY KEY exclusion (#11826) (#12035)
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 <noreply@anthropic.com>
1 parent ae25b0c commit 3b9da58

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/objectql/src/util.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ export interface IntrospectedColumn extends SpecIntrospectedColumn {
4242
* — is the contract sentence; this is the consumer-side copy of the same
4343
* key and must not drift from it. An absent flag on a composite member
4444
* means "not single-column unique", never "no constraint".
45+
*
46+
* A PRIMARY KEY is NOT a unique constraint to this flag (#11654), on any
47+
* dialect and for any key type. `isUnique` means a *declared*
48+
* single-column UNIQUE constraint; key membership has a lossless face of
49+
* its own ({@link IntrospectedTable.primaryKeys} and `primaryKey` below),
50+
* so excluding keys keeps the two flags non-overlapping and drops no
51+
* fact. Note this is a statement about what KIND of constraint the flag
52+
* reports, never a claim that a key column admits duplicates. A key
53+
* column that separately carries its own single-column unique constraint
54+
* is still flagged — the constraint is what is being reported, not the
55+
* column.
4556
*/
4657
isUnique?: boolean;
4758
/**

0 commit comments

Comments
 (0)