Skip to content

Commit 172256a

Browse files
fix(react-cra): handle drizzle + better-sqlite3 driver error caused by DATABASE_URL prefix (#210)
fix(tanstack-start): handle better-sqlite3 driver error caused by DATABASE_URL prefix The TanStack Start app fails to initialize when using the drizzle + sqlite add-on with the following error: Cannot open database because the directory does not exist This happens because the generated `DATABASE_URL` is set to `file:./dev.db`, but the `better-sqlite3` driver does not support the `file:` prefix. This commit removes that prefix and sets `DATABASE_URL` to `dev.db` to ensure the app starts correctly.
1 parent 7a8082c commit 172256a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

frameworks/react-cra/add-ons/drizzle/assets/_dot_env.local.append.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ DATABASE_URL="postgresql://username:password@localhost:5432/mydb"<% } else if (a
44
# Database URL for MySQL
55
DATABASE_URL="mysql://username:password@localhost:3306/mydb"<% } else if (addOnOption.drizzle.database === 'sqlite') { %>
66
# Database URL for SQLite
7-
DATABASE_URL="file:./dev.db"<% } %>
7+
DATABASE_URL="dev.db"<% } %>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is auto-generated. Do not edit manually.
22
// Generated from add-ons, examples, hosts, project, and toolchains directories
3-
export const contentChecksum = '2bc5d6d1275fc866a1561719c657003610a9c50e837678758f63632b4eea34a0'
3+
export const contentChecksum = '5e28990850f8cfa59f2d4c9f4365968422deb2a849d6915134fc10b1417fa096'

0 commit comments

Comments
 (0)