mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 18:53:05 +00:00
30 lines
846 B
TypeScript
30 lines
846 B
TypeScript
import fs from 'node:fs';
|
|
import path from 'node:path';
|
|
import { defineConfig } from 'drizzle-kit';
|
|
|
|
const config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
|
|
const { database } = config;
|
|
|
|
export default defineConfig({
|
|
out: './drizzle',
|
|
schema: './src/db/schema.ts',
|
|
dialect: 'postgresql',
|
|
dbCredentials: {
|
|
url: database.dbConnectionString,
|
|
ssl: (() => {
|
|
try {
|
|
return {
|
|
ca: fs.readFileSync(path.resolve('./certs/psql-ca.crt')),
|
|
key: fs.readFileSync(path.resolve('./certs/psql-client.key')),
|
|
cert: fs.readFileSync(path.resolve('./certs/psql-server.crt')),
|
|
};
|
|
} catch (error) {
|
|
console.warn(
|
|
'Failed to load certificates for database, using insecure connection:',
|
|
error,
|
|
);
|
|
return undefined;
|
|
}
|
|
})(),
|
|
},
|
|
});
|