KHRM
KHRM
Explore posts from servers
DTDrizzle Team
Created by KHRM on 5/5/2024 in #help
Auth.js (next-auth) with Drizzle Provider Typescript
Hello so in the guide for the drizzle provider for Auth.js (next-auth) it says we can override the tables for example if i want to give me my users table a password and role field but then i run into a typescript error since the tables are typed in a specific way inside the adapter itself
adapter: {
/**
* Argument of type '{ usersTable: SQLiteTableWithColumns<{ name: "user"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "SQLiteText"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, object>; ... 5 more ...; role...' is not assignable to parameter of type 'DefaultSQLiteSchema'.
Type '{ usersTable: SQLiteTableWithColumns<{ name: "user"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "SQLiteText"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, object>; ... 5 more ...; role...' is missing the following properties from type 'DefaultSQLiteSchema': accountsTable, sessionsTable, verificationTokensTablets(2345)
*/
...DrizzleAdapter(db, { usersTable: users }),
adapter: {
/**
* Argument of type '{ usersTable: SQLiteTableWithColumns<{ name: "user"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "SQLiteText"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, object>; ... 5 more ...; role...' is not assignable to parameter of type 'DefaultSQLiteSchema'.
Type '{ usersTable: SQLiteTableWithColumns<{ name: "user"; schema: undefined; columns: { id: SQLiteColumn<{ name: "id"; tableName: "user"; dataType: "string"; columnType: "SQLiteText"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [...]; baseColumn: never; }, object>; ... 5 more ...; role...' is missing the following properties from type 'DefaultSQLiteSchema': accountsTable, sessionsTable, verificationTokensTablets(2345)
*/
...DrizzleAdapter(db, { usersTable: users }),
4 replies