Skip to content

Commit

Permalink
perf: migrate prisma to drizzle.
Browse files Browse the repository at this point in the history
  • Loading branch information
elonehoo committed Sep 20, 2024
1 parent ae08652 commit 276d03e
Show file tree
Hide file tree
Showing 15 changed files with 2,728 additions and 1,870 deletions.
11 changes: 4 additions & 7 deletions app/pages/hi/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@ definePageMeta({

<p text-sm my-4>
<span op-50>Also as known as:</span>
<ul>
<li>
<router-link :to="`/hi/${data?.user?.name}`" replace>
{{ data?.user?.name }}
</router-link>
</li>
</ul>
<br>
<router-link :to="`/hi/${data?.user[0]?.name}`" replace>
{{ data?.user[0]?.name }}
</router-link>
</p>

<LazyCounter />
Expand Down
10 changes: 10 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'drizzle-kit'

export default defineConfig({
dialect: 'postgresql',
schema: './server/database/schema',
out: './server/database/migrations',
dbCredentials: {
url: process.env.DATABASE_URL!,
},
})
16 changes: 0 additions & 16 deletions lib/prisma.ts

This file was deleted.

6 changes: 6 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ export default defineNuxtConfig({
enabled: true,
},
},
runtimeConfig: {
db: {
url: process.env.DATABASE_URL,
dir: './server/db',
},
},
})
34 changes: 18 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"scripts": {
"build": "nuxi build",
"dev": "nuxi dev --dotenv .env.local",
"db:generate": "drizzle-kit generate",
"start": "node .output/server/index.mjs",
"test": "vitest",
"lint": "eslint .",
Expand All @@ -17,28 +18,29 @@
"release": "bumpp package.json --commit --push --tag"
},
"dependencies": {
"@vueuse/core": "^11.0.1",
"nuxt": "^3.13.0",
"@vueuse/core": "^11.1.0",
"drizzle-orm": "^0.33.0",
"nuxt": "^3.13.2",
"pinia": "^2.2.2",
"unocss": "^0.62.2"
"postgres": "^3.4.4",
"unocss": "^0.62.4"
},
"devDependencies": {
"@antfu/eslint-config": "^2.27.1",
"@iconify-json/carbon": "^1.1.37",
"@iconify-json/twemoji": "^1.1.16",
"@nuxt/devtools": "^1.3.14",
"@nuxtjs/color-mode": "^3.4.4",
"@antfu/eslint-config": "^3.6.2",
"@iconify-json/carbon": "^1.2.1",
"@iconify-json/twemoji": "^1.2.0",
"@nuxt/devtools": "^1.4.2",
"@nuxtjs/color-mode": "^3.5.1",
"@pinia/nuxt": "^0.5.4",
"@prisma/client": "^5.18.0",
"@unocss/nuxt": "^0.62.2",
"@vueuse/nuxt": "^11.0.1",
"@unocss/nuxt": "^0.62.4",
"@vueuse/nuxt": "^11.1.0",
"bumpp": "^9.5.2",
"eslint": "^9.9.0",
"happy-dom": "^15.0.0",
"drizzle-kit": "^0.24.2",
"eslint": "^9.10.0",
"happy-dom": "^15.7.4",
"nuxt-module-chrome-devtools": "^0.0.5",
"nuxt-vitest": "^0.11.5",
"prisma": "^5.18.0",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
"typescript": "^5.6.2",
"vitest": "^2.1.1"
}
}
Loading

0 comments on commit 276d03e

Please sign in to comment.