From 3036a2efaf5732d9d488a04dea2ac8592f994580 Mon Sep 17 00:00:00 2001 From: pilcrow Date: Tue, 6 Aug 2024 08:22:17 +0900 Subject: [PATCH] Fix types in Drizzle adapter (#1655) --- packages/adapter-drizzle/src/drivers/mysql.ts | 16 ++++++++++++++++ .../adapter-drizzle/src/drivers/sqlite.ts | 19 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/packages/adapter-drizzle/src/drivers/mysql.ts b/packages/adapter-drizzle/src/drivers/mysql.ts index b8567a6cf..f3d079a52 100644 --- a/packages/adapter-drizzle/src/drivers/mysql.ts +++ b/packages/adapter-drizzle/src/drivers/mysql.ts @@ -94,6 +94,10 @@ export type MySQLUserTable = MySqlTableWithColumns<{ hasDefault: boolean; // must be boolean instead of any to allow default values enumValues: any; baseColumn: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >; @@ -116,6 +120,10 @@ export type MySQLSessionTable = MySqlTableWithColumns<{ driverParam: any; hasDefault: false; name: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >; @@ -130,6 +138,10 @@ export type MySQLSessionTable = MySqlTableWithColumns<{ driverParam: any; hasDefault: false; name: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >; @@ -144,6 +156,10 @@ export type MySQLSessionTable = MySqlTableWithColumns<{ driverParam: any; hasDefault: false; name: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >; diff --git a/packages/adapter-drizzle/src/drivers/sqlite.ts b/packages/adapter-drizzle/src/drivers/sqlite.ts index 37a9364bc..b2593d684 100644 --- a/packages/adapter-drizzle/src/drivers/sqlite.ts +++ b/packages/adapter-drizzle/src/drivers/sqlite.ts @@ -53,7 +53,8 @@ export class DrizzleSQLiteAdapter implements Adapter { } private async getUserFromSessionId(sessionId: string): Promise { - const { _, $inferInsert, $inferSelect, getSQL, ...userColumns } = this.userTable; + const { _, $inferInsert, $inferSelect, getSQL, shouldOmitSQLParens, ...userColumns } = + this.userTable; const result = await this.db .select(userColumns) .from(this.sessionTable) @@ -118,6 +119,10 @@ export type SQLiteUserTable = SQLiteTableWithColumns<{ hasDefault: boolean; // must be boolean instead of any to allow default values enumValues: any; baseColumn: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >; @@ -140,6 +145,10 @@ export type SQLiteSessionTable = SQLiteTableWithColumns<{ driverParam: any; hasDefault: false; name: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >; @@ -154,6 +163,10 @@ export type SQLiteSessionTable = SQLiteTableWithColumns<{ driverParam: any; hasDefault: false; name: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >; @@ -168,6 +181,10 @@ export type SQLiteSessionTable = SQLiteTableWithColumns<{ driverParam: any; hasDefault: false; name: any; + isPrimaryKey: any; + isAutoincrement: any; + hasRuntimeDefault: any; + generated: any; }, object >;