Skip to content

Commit a96228c

Browse files
committed
chore: allow changing of prisma maria db config through env
1 parent 61badc0 commit a96228c

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ AUTO_RELOAD=false
5151
# the database connection URL
5252
DATABASE_URL=mysql://root@127.0.0.1:3306/project_canis
5353
SHADOW_DATABASE_URL=mysql://root@127.0.0.1:3306/project_canis_shadow
54+
55+
# prisma maria db adapter config
56+
PRISMA_MARIA_DB_HOST=127.0.0.1
57+
PRISMA_MARIA_DB_PORT=3306
58+
PRISMA_MARIA_DB_CONNECTION_LIMIT=5
59+
60+
# redis cache
5461
REDIS_URL=redis://127.0.0.1:6379
5562

5663
# the AI provider to use for AI model access

src/components/prisma.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ declare global {
66
}
77

88
const adapter = new PrismaMariaDb({
9-
host: "localhost",
10-
port: 3306,
11-
connectionLimit: 5,
9+
host: process.env.PRISMA_MARIA_DB_HOST || "127.0.0.1",
10+
port: parseInt(process.env.PRISMA_MARIA_DB_PORT || "3306"),
11+
connectionLimit: parseInt(process.env.PRISMA_MARIA_DB_CONNECTION_LIMIT || "5"),
1212
});
1313

1414
const prisma = global._sharedPrisma ?? new PrismaClient({ adapter });

0 commit comments

Comments
 (0)