Last active
April 2, 2023 10:09
-
-
Save lawrencecchen/9f3ea8e05ba1ae321da986cd1330c930 to your computer and use it in GitHub Desktop.
Revisions
-
lawrencecchen revised this gist
Apr 2, 2023 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,8 @@ export type Database = { export const db = new Kysely<Database>({ dialect: new PlanetScaleDialect({ host: process.env.DATABASE_HOST, username: process.env.DATABASE_USERNAME, password: process.env.DATABASE_PASSWORD, }), }); -
lawrencecchen revised this gist
Apr 2, 2023 . No changes.There are no files selected for viewing
-
lawrencecchen revised this gist
Apr 2, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ import { Kysely } from "kysely"; import { PlanetScaleDialect } from "kysely-planetscale"; import { type z } from "zod"; import * as Models from "./prisma/generated/zod/modelSchema"; -
lawrencecchen created this gist
Apr 2, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ import { Kysely } from "kysely"; import { PlanetScaleDialect } from "kysely-planetscale"; import { z } from "zod"; import * as Models from "./prisma/generated/zod/modelSchema"; type RemoveSchema<S extends string> = S extends `${infer Prefix}Schema` ? Prefix : S; export type Database = { [K in keyof typeof Models as RemoveSchema<K>]: z.infer<(typeof Models)[K]>; }; export const db = new Kysely<Database>({ dialect: new PlanetScaleDialect({ url: process.env.DATABASE_URL, }), }); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ generator zod { provider = "zod-prisma-types" useMultipleFiles = true }