Initial commit
This commit is contained in:
13
server/utils/drizzle.ts
Normal file
13
server/utils/drizzle.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { drizzle } from "drizzle-orm/d1";
|
||||
export { sql, eq, and, or } from "drizzle-orm";
|
||||
|
||||
import * as schema from "../database/schema";
|
||||
|
||||
export const tables = schema;
|
||||
|
||||
export function useDrizzle() {
|
||||
return drizzle(hubDatabase(), { schema });
|
||||
}
|
||||
|
||||
export type User = typeof schema.users.$inferSelect;
|
||||
export type Tokens = typeof schema.tokens.$inferSelect;
|
||||
Reference in New Issue
Block a user