Skip to content

Commit be514a2

Browse files
fix(types): relax type constraints broken by stripInternal
Two fixes for type declarations that become invalid after @internal properties are stripped from .d.ts output: 1. Relax SelectWithout generic constraint from K extends keyof T & string to K extends string in MySQL, SingleStore, and SQLite select types. The keyof T constraint fails when @internal-stripped properties like 'session' appear in excluded method lists but are absent from the emitted type. Omit<> already handles missing keys safely. 2. Remove implements PgPolicyConfig/GelPolicyConfig from PgPolicy/GelPolicy class declarations. The optional config properties (as?, for?) are declared as non-optional readonly in the class, and @internal properties are stripped, making the implements clause invalid. The class remains structurally compatible without the clause.
1 parent e8e6edf commit be514a2

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

drizzle-orm/src/gel-core/policies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface GelPolicyConfig {
2020
withCheck?: SQL;
2121
}
2222

23-
export class GelPolicy implements GelPolicyConfig {
23+
export class GelPolicy {
2424
static readonly [entityKind]: string = 'GelPolicy';
2525

2626
readonly as: GelPolicyConfig['as'];

drizzle-orm/src/mysql-core/query-builders/select.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export type MySqlSetOperatorExcludedMethods =
243243
export type MySqlSelectWithout<
244244
T extends AnyMySqlSelectQueryBuilder,
245245
TDynamic extends boolean,
246-
K extends keyof T & string,
246+
K extends string,
247247
TResetExcluded extends boolean = false,
248248
> = TDynamic extends true ? T : Omit<
249249
MySqlSelectKind<

drizzle-orm/src/pg-core/policies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface PgPolicyConfig {
2020
withCheck?: SQL;
2121
}
2222

23-
export class PgPolicy implements PgPolicyConfig {
23+
export class PgPolicy {
2424
static readonly [entityKind]: string = 'PgPolicy';
2525

2626
readonly as: PgPolicyConfig['as'];

drizzle-orm/src/singlestore-core/query-builders/select.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export type SingleStoreSetOperatorExcludedMethods =
228228
export type SingleStoreSelectWithout<
229229
T extends AnySingleStoreSelectQueryBuilder,
230230
TDynamic extends boolean,
231-
K extends keyof T & string,
231+
K extends string,
232232
TResetExcluded extends boolean = false,
233233
> = TDynamic extends true ? T : Omit<
234234
SingleStoreSelectKind<

drizzle-orm/src/sqlite-core/query-builders/select.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export type CreateSQLiteSelectFromBuilderMode<
235235
export type SQLiteSelectWithout<
236236
T extends AnySQLiteSelectQueryBuilder,
237237
TDynamic extends boolean,
238-
K extends keyof T & string,
238+
K extends string,
239239
TResetExcluded extends boolean = false,
240240
> = TDynamic extends true ? T : Omit<
241241
SQLiteSelectKind<

0 commit comments

Comments
 (0)