Skip to content

fix(types): relax type constraints broken by stripInternal#5409

Open
YevheniiKotyrlo wants to merge 1 commit intodrizzle-team:mainfrom
YevheniiKotyrlo:fix/type-constraints-for-strip-internal
Open

fix(types): relax type constraints broken by stripInternal#5409
YevheniiKotyrlo wants to merge 1 commit intodrizzle-team:mainfrom
YevheniiKotyrlo:fix/type-constraints-for-strip-internal

Conversation

@YevheniiKotyrlo
Copy link
Copy Markdown

Summary

Two fixes for type declarations that become invalid after @internal properties are stripped from .d.ts output by stripInternal: true:

1. Relax SelectWithout generic constraint (3 files)

K extends keyof T & stringK extends string in:

  • src/mysql-core/query-builders/select.types.ts
  • src/singlestore-core/query-builders/select.types.ts
  • src/sqlite-core/query-builders/select.types.ts

The constraint fails because set operator excluded method lists include 'session' — a property marked @internal and stripped from .d.ts. When 'session' is absent from the emitted type, 'session' no longer satisfies keyof T & string. Omit<> already handles missing keys safely (they're simply ignored), so K extends string is sufficient.

2. Remove implements clause from Policy classes (2 files)

PgPolicy implements PgPolicyConfigPgPolicy in:

  • src/pg-core/policies.ts
  • src/gel-core/policies.ts

The config interfaces have optional properties (as?, for?), but the class declares them as non-optional readonly. After @internal stripping, the implements clause produces TS2420 because the structural match fails. The class remains structurally compatible without the clause — removing it eliminates the false type error without changing behavior.

Related: #5187, #4299

@YevheniiKotyrlo YevheniiKotyrlo force-pushed the fix/type-constraints-for-strip-internal branch from be514a2 to bfeec12 Compare April 9, 2026 13:13
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