From 8ffb507b2a1186682e4b0d1faccd3280f1da01eb Mon Sep 17 00:00:00 2001 From: Lazar Nikolov Date: Mon, 9 Sep 2024 11:11:27 -0400 Subject: [PATCH] extracted schema type --- drizzle/index.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drizzle/index.ts b/drizzle/index.ts index 673f095..4b618ef 100644 --- a/drizzle/index.ts +++ b/drizzle/index.ts @@ -17,13 +17,14 @@ export const db = drizzle(client, { schema: { users, sessions, todos } }); export const luciaAdapter = new DrizzleSQLiteAdapter(db, sessions, users); // Export Transaction type to be used in repositories +type Schema = { + users: typeof users; + sessions: typeof sessions; + todos: typeof todos; +}; export type Transaction = SQLiteTransaction< "async", ResultSet, - { users: typeof users; sessions: typeof sessions; todos: typeof todos }, - ExtractTablesWithRelations<{ - users: typeof users; - sessions: typeof sessions; - todos: typeof todos; - }> + Schema, + ExtractTablesWithRelations >;