mirror of
https://codeberg.org/MarkusThielker/next-ory.git
synced 2025-04-10 11:58:41 +00:00
NORY-41: add basic drizzle configuration
This commit is contained in:
parent
70e376615d
commit
a60800ad01
5 changed files with 24 additions and 0 deletions
14
dashboard/drizzle.config.ts
Normal file
14
dashboard/drizzle.config.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
'use server';
|
||||||
|
|
||||||
|
import 'dotenv/config';
|
||||||
|
import { defineConfig } from 'drizzle-kit';
|
||||||
|
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
out: './drizzle',
|
||||||
|
schema: './src/db/schema.ts',
|
||||||
|
dialect: 'postgresql',
|
||||||
|
dbCredentials: {
|
||||||
|
url: process.env.DATABASE_URL!,
|
||||||
|
},
|
||||||
|
});
|
0
dashboard/drizzle/relations.ts
Normal file
0
dashboard/drizzle/relations.ts
Normal file
0
dashboard/drizzle/schema.ts
Normal file
0
dashboard/drizzle/schema.ts
Normal file
10
dashboard/src/db/index.ts
Normal file
10
dashboard/src/db/index.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
'use server';
|
||||||
|
|
||||||
|
import 'dotenv/config';
|
||||||
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
||||||
|
|
||||||
|
const db = drizzle(process.env.DATABASE_URL!);
|
||||||
|
|
||||||
|
export async function getDB() {
|
||||||
|
return db;
|
||||||
|
}
|
0
dashboard/src/db/schema.ts
Normal file
0
dashboard/src/db/schema.ts
Normal file
Loading…
Add table
Reference in a new issue