Skip to content

Commit

Permalink
wip: try to port ORM to drizzle
Browse files Browse the repository at this point in the history
  • Loading branch information
thathurtabit committed Dec 2, 2024
1 parent 33f66ed commit 3885516
Show file tree
Hide file tree
Showing 9 changed files with 947 additions and 92 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
/.pnp
.pnp.js

#db
nmig

# testing
/coverage

Expand Down
13 changes: 13 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { type Config } from "drizzle-kit";

import { environment } from "~/environment.mjs";
const { DATABASE_URL } = environment;

export default {
schema: "./src/server/db/drizzle.schema.ts",
dialect: "postgresql",
out: "./src/server/migrations",
dbCredentials: {
url: DATABASE_URL,
},
} satisfies Config;
13 changes: 10 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"commit": "sh ./commit.sh",
"build": "pnpm run db:generate && next build",
"postbuild": "next-sitemap",
"db:pull": "prisma db pull",
"db:push": "prisma db push",
"db:validate": "prisma validate",
"db:studio": "prisma studio",
"db:generate": "prisma generate",
"next:dev": "pnpm run db:generate && next dev --hostname dev.localhost",
Expand All @@ -28,8 +30,8 @@
"prepare": "husky install"
},
"dependencies": {
"@next-auth/prisma-adapter": "^1.0.7",
"@prisma/client": "^5.18.0",
"@auth/drizzle-adapter": "^1.7.4",
"@prisma/client": "^6.0.1",
"@react-email/button": "0.0.16",
"@react-email/container": "0.0.13",
"@react-email/heading": "0.0.13",
Expand All @@ -46,6 +48,7 @@
"@types/next-pwa": "^5.6.9",
"@uidotdev/usehooks": "^2.4.1",
"@vercel/postgres": "^0.9.0",
"drizzle-orm": "^0.36.4",
"focus-trap-react": "^10.2.3",
"mailersend": "^2.2.0",
"next": "^14.2.5",
Expand All @@ -63,6 +66,7 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@auth/drizzle-adapter": "^0.9.0",
"@commitlint/cli": "^19.4.0",
"@storybook/addon-essentials": "^7.6.20",
"@storybook/addon-interactions": "^7.6.20",
Expand Down Expand Up @@ -90,6 +94,8 @@
"concurrently": "^8.2.2",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^7.2.1",
"drizzle-kit": "^0.28.1",
"drizzle-prisma-generator": "^0.1.7",
"eslint": "^8.57.0",
"eslint-config-next": "^14.0.4",
"eslint-config-xo": "^0.45.0",
Expand All @@ -103,9 +109,10 @@
"jsdom": "^22.1.0",
"next-sitemap": "^4.2.3",
"postcss": "^8.4.41",
"postgres": "^3.4.5",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.5.14",
"prisma": "^5.18.0",
"prisma": "^6.0.1",
"storybook": "^7.5.3",
"tailwindcss": "^3.4.9",
"typescript": "^5.5.4",
Expand Down
Loading

0 comments on commit 3885516

Please sign in to comment.