Skip to content

Commit

Permalink
feat: db
Browse files Browse the repository at this point in the history
  • Loading branch information
qin-guan committed Sep 16, 2023
1 parent 3aadb3a commit 8c12301
Show file tree
Hide file tree
Showing 11 changed files with 2,540 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"@antfu"
],
"rules": {
// https://github.com/antfu/eslint-config/pull/214
"n/prefer-global/process": [
"off",
"never"
]
}
}
14 changes: 14 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import * as dotenv from 'dotenv'
import type { Config } from 'drizzle-kit'

dotenv.config()

export default {
schema: './server/db/schema.ts',
out: './server/drizzle',
driver: 'turso',
dbCredentials: {
url: process.env.TURSO_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
},
} satisfies Config
8 changes: 7 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true }
devtools: { enabled: true },
runtimeConfig: {
turso: {
url: '' || process.env.TURSO_URL,
authToken: '' || process.env.TURSO_AUTH_TOKEN,
},
},
})
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
{
"name": "nuxt-app",
"private": true,
"type": "module",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
"postinstall": "nuxt prepare",
"db:generate": "drizzle-kit generate:sqlite",
"db:push": "drizzle-kit push:sqlite",
"db:drop": "drizzle-kit drop"
},
"devDependencies": {
"@antfu/eslint-config": "^0.42.0",
"@libsql/client": "^0.3.4",
"@nuxt/devtools": "latest",
"@paralleldrive/cuid2": "^2.2.2",
"dotenv": "^16.3.1",
"drizzle-kit": "^0.19.13",
"drizzle-orm": "^0.28.6",
"eslint": "^8.49.0",
"nuxt": "^3.7.3"
}
}
Loading

0 comments on commit 8c12301

Please # to comment.