-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec7f1d3
commit 3fed779
Showing
8 changed files
with
70 additions
and
81 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,6 @@ yarn-error.log* | |
# Misc | ||
.DS_Store | ||
*.pem | ||
|
||
# SQLite | ||
local.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
NEXT_PUBLIC_COLLAB_SERVER_URL=ws://localhost:1234 | ||
|
||
# Local development database | ||
# This should match the same one configured for the collaboration server | ||
DATABASE_URL=mysql://root:pass@localhost/jotter | ||
|
||
TURSO_DATABASE_URL=file:../../local.db | ||
|
||
NEXTAUTH_URL=http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import mysql from "mysql2/promise"; | ||
import env from "@/config/env-server"; | ||
import { drizzle } from "drizzle-orm/mysql2"; | ||
import * as schema from "@/schema"; | ||
import { createClient } from "@libsql/client"; | ||
import { drizzle } from "drizzle-orm/libsql"; | ||
|
||
const connection = await mysql.createConnection(env.DATABASE_URL); | ||
const connection = await createClient({ | ||
url: env.TURSO_DATABASE_URL, | ||
authToken: env.TURSO_AUTH_TOKEN, | ||
}); | ||
|
||
const db = drizzle(connection, { mode: "planetscale", schema }); | ||
const db = drizzle(connection, { schema }); | ||
|
||
export default db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters