Vinz
Vinz
DTDrizzle Team
Created by peterstnsz on 6/1/2024 in #help
Supabase + Drizzle + Nuxt 3 + Node - SSL 'SELF_SIGNED_CERT_IN_CHAIN' and drizzle-kit studio issues
I using drizzle + ssl enforced. drizzle config
const caString = fs.readFileSync("xxx.crt").toString();
// URL encode the certificate
const caStringEncoded = encodeURIComponent(caString);

// Construct the database URL with SSL parameters
const dbUrl = new URL(env.DB_URL!);
dbUrl.searchParams.append("sslmode", "require");
dbUrl.searchParams.append("sslrootcert", caStringEncoded);

export default defineConfig({
dialect: "postgresql",
out: "./drizzle",
schema: "./db/schema/*",
dbCredentials: {
url: dbUrl.toString(),
},
schemaFilter: ["public"],
});
const caString = fs.readFileSync("xxx.crt").toString();
// URL encode the certificate
const caStringEncoded = encodeURIComponent(caString);

// Construct the database URL with SSL parameters
const dbUrl = new URL(env.DB_URL!);
dbUrl.searchParams.append("sslmode", "require");
dbUrl.searchParams.append("sslrootcert", caStringEncoded);

export default defineConfig({
dialect: "postgresql",
out: "./drizzle",
schema: "./db/schema/*",
dbCredentials: {
url: dbUrl.toString(),
},
schemaFilter: ["public"],
});
file for drizzle db
...
const connectionString = process.env.DB_URL!;
const client = postgres(connectionString, {
ssl: {
rejectUnauthorized: true,
ca: fs.readFileSync("xxx").toString(),
},
});
...
...
const connectionString = process.env.DB_URL!;
const client = postgres(connectionString, {
ssl: {
rejectUnauthorized: true,
ca: fs.readFileSync("xxx").toString(),
},
});
...
5 replies