Skip to content

Commit

Permalink
drizzle
Browse files Browse the repository at this point in the history
  • Loading branch information
C4illin committed Dec 2, 2024
1 parent ce895d2 commit 02a797d
Show file tree
Hide file tree
Showing 8 changed files with 745 additions and 989 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ yarn-error.log*
next-env.d.ts
/.env
data/db.sqlite
/migrations
2 changes: 2 additions & 0 deletions app/components/login-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import { signIn } from "next-auth/react";

export function LoginButton() {
// const tenant = "chalmers.se";
// const product = "G.U.D. Gaming";
const tenant = "boxyhq.com";
const product = "saml-demo.boxyhq.com";

Expand Down
12 changes: 7 additions & 5 deletions app/db/drizzle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { drizzle } from 'drizzle-orm/libsql';
import { drizzle } from "drizzle-orm/libsql";

export const db = drizzle({ connection: {
url: "./data/db.sqlite",
authToken: process.env.DATABASE_AUTH_TOKEN
}});
export const db = drizzle({
connection: {
url: "./data/db.sqlite",
authToken: process.env.DATABASE_AUTH_TOKEN,
},
});
2 changes: 1 addition & 1 deletion app/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export const minecraft = sqliteTable("minecraft", {
userid: int().references(() => users.id),
username: text().unique(),
uuid: text().unique(),
});
});
7 changes: 7 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Config } from "drizzle-kit";

export default {
schema: "./app/db/schema.ts",
out: "./migrations",
dialect: "sqlite",
} satisfies Config;
Loading

0 comments on commit 02a797d

Please sign in to comment.