feat(create-turbo): create https://github.com/juliusmarminge/acme-corp
This commit is contained in:
22
packages/db/index.ts
Normal file
22
packages/db/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Generated by prisma/post-generate.ts
|
||||
|
||||
import { Kysely } from "kysely";
|
||||
import { PlanetScaleDialect } from "kysely-planetscale";
|
||||
import { customAlphabet } from "nanoid";
|
||||
|
||||
import type { DB } from "./prisma/types";
|
||||
|
||||
export { jsonArrayFrom, jsonObjectFrom } from "kysely/helpers/postgres";
|
||||
|
||||
export * from "./prisma/types";
|
||||
export * from "./prisma/enums";
|
||||
|
||||
export const db = new Kysely<DB>({
|
||||
dialect: new PlanetScaleDialect({
|
||||
url: process.env.DATABASE_URL,
|
||||
}),
|
||||
});
|
||||
|
||||
// Use custom alphabet without special chars for less chaotic, copy-able URLs
|
||||
// Will not collide for a long long time: https://zelark.github.io/nano-id-cc/
|
||||
export const genId = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyz", 16);
|
||||
Reference in New Issue
Block a user