Skip to content

Commit

Permalink
extracted schema type
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolovlazar committed Sep 9, 2024
1 parent 49280fd commit 8ffb507
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drizzle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Schema>
>;

0 comments on commit 8ffb507

Please sign in to comment.