Skip to content

Commit

Permalink
Official Drizzle Studio for D1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy Miller committed Nov 10, 2023
1 parent 56d5f15 commit 72b733c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 73 deletions.
2 changes: 1 addition & 1 deletion apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@babel/runtime": "^7.23.2",
"@shopify/flash-list": "^1.6.2",
"@shopify/flash-list": "^1.6.3",
"@t4/ui": "*",
"app": "*",
"babel-plugin-module-resolver": "^5.0.0",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
18 changes: 7 additions & 11 deletions packages/api/drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import * as dotenv from 'dotenv'
import type { Config } from 'drizzle-kit'
dotenv.config({ path: './.dev.vars' })

const DATABASE_ID = process.env.DATABASE_ID
if (DATABASE_ID === undefined) {
throw new Error('DATABASE_ID is undefined')
}

export default {
driver: 'better-sqlite',
dbCredentials: {
url: `./.wrangler/state/v3/d1/${DATABASE_ID}/db.sqlite`,
},
schema: './src/db/schema.ts',
out: './migrations',
driver: 'd1',
dbCredentials: {
wranglerConfigPath: 'wrangler.toml',
dbName: 'production',
},
verbose: false,
strict: true,
} satisfies Config
10 changes: 5 additions & 5 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"migrate:local": "wrangler d1 migrations apply production --local",
"seed": "wrangler d1 execute production --file=./seed/seed.sql",
"seed:local": "wrangler d1 execute production --local --file=./seed/seed.sql",
"studio": "cd .wrangler/ && bun ../src/db/studio.ts",
"studio": "drizzle-kit studio",
"deploy": "wrangler deploy --minify src/worker.ts",
"postinstall": "bun generate",
"clean": "rm -rf .turbo node_modules"
},
"dependencies": {
"@hono/trpc-server": "^0.1.0",
"@trpc/server": "^10.43.1",
"@trpc/server": "^10.43.2",
"@tsndr/cloudflare-worker-jwt": "^2.2.5",
"drizzle-orm": "^0.28.6",
"drizzle-orm": "^0.29.0",
"drizzle-valibot": "^0.1.1",
"hono": "^3.9.2",
"miniflare": "3.20231025.1",
Expand All @@ -28,8 +28,8 @@
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231025.0",
"bun-types": "^1.0.10",
"drizzle-kit": "^0.19.13",
"bun-types": "^1.0.11",
"drizzle-kit": "^0.20.1",
"typescript": "^5.2.2",
"wrangler": "^3.15.0"
}
Expand Down
41 changes: 0 additions & 41 deletions packages/api/src/db/studio.ts

This file was deleted.

12 changes: 5 additions & 7 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
"version": "2.0.0",
"main": "index.ts",
"private": true,
"sideEffects": [
"*.css"
],
"sideEffects": ["*.css"],
"scripts": {
"clean": "rm -rf node_modules"
},
"dependencies": {
"@shopify/flash-list": "^1.6.2",
"@shopify/flash-list": "^1.6.3",
"@t4/ui": "*",
"@tamagui/animations-react-native": "1.75.9",
"@tamagui/colors": "1.75.9",
Expand All @@ -19,9 +17,9 @@
"@tamagui/shorthands": "1.75.9",
"@tamagui/themes": "1.75.9",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.43.1",
"@trpc/next": "^10.43.1",
"@trpc/react-query": "^10.43.1",
"@trpc/client": "^10.43.2",
"@trpc/next": "^10.43.2",
"@trpc/react-query": "^10.43.2",
"burnt": "^0.12.1",
"expo-constants": "~14.4.2",
"expo-linking": "6.0.0",
Expand Down
11 changes: 3 additions & 8 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
{
"name": "@t4/ui",
"version": "2.0.0",
"sideEffects": [
"*.css"
],
"sideEffects": ["*.css"],
"private": true,
"main": "src/index.tsx",
"module:jsx": "src",
"files": [
"types",
"dist"
],
"files": ["types", "dist"],
"scripts": {
"build": "tamagui-build",
"watch": "tamagui-build --watch",
"clean": "rm -rf dist types node_modules .turbo"
},
"dependencies": {
"@shopify/flash-list": "^1.6.2",
"@shopify/flash-list": "^1.6.3",
"@supabase/supabase-js": "^2.38.4",
"@t4/api": "*",
"@tamagui/animations-react-native": "1.75.9",
Expand Down

1 comment on commit 72b733c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✔ EAS production build completed

  • 🤖 Android build failed ❌
  • 🍏 IOS build failed ❌
Android QR IOS QR

Please sign in to comment.