- import { Context } from "hono"
- import { Database } from "./types"
- import { Kysely } from "kysely"
- import { D1Dialect } from "kysely-d1"
- export const getDB = (c: Context<Environment>) => {
- return new Kysely<Database>({
- dialect: new D1Dialect({ database: c.env.DB })
- })
- }
|