Open statusunknown418 opened 9 months ago
Can you share a redacted version of your configuration? This error is fundamentally an SSL issue. So maybe trying to use http when we require https, or the TLS version is too low, which would be quite a bit odd. We require TLS 1.2+.
how do I update TLS? this is my db/index.ts
file
import { connect } from "@planetscale/database";
import { drizzle } from "drizzle-orm/planetscale-serverless";
// create the connection
export const connection = connect({
url: process.env.DATABASE_URL!,
});
export const db = drizzle(connection);
It's not typically something you do directly and comes from the underlying networking libraries of the runtime.
Where are you running this and can you share a redacted version of that DATABASE_URL?
running locally, using drizzle
:
DATABASE_URL=mysql://user:pass@aws.connect.psdb.cloud:3306/toldyouso?ssl={"rejectUnauthorized": true}
Aha, so that's what I was looking for. Using port 3306 doesn't work. We should auto fix this in database-js, but this connection string is not correct here.
You'd want something like this:
DATABASE_URL=https://user:pass@aws.connect.psdb.cloud
I'll open up and issue about ignoring the 3306 part since that will never work.
right thanks a lot!, I also tried using USERNAME
, HOST
and PASSWORD
instead, like this:
import { env } from "~/env.mjs";
import * as schema from "./schema";
import { connect } from "@planetscale/database";
import { drizzle } from "drizzle-orm/planetscale-serverless";
// create the connection
const connection = connect({
host: env.DATABASE_HOST,
username: env.DATABASE_USERNAME,
password: env.DATABASE_PASSWORD,
});
export const db = drizzle(connection, { schema });
and this seems to work nicely too
this issue had me blocked for hours lol
When you had to split up, was :3306
inside DATABASE_HOST
too? If so, same issue.
actually not, I used the credentials generated from pscale cli and it only included the name aws.psdb.cloud.com
running into that issue using prisma/kysely and the planetscale cli proxy that allows me to connect to mysql://127.0.0.1/foo
any way around it?
getting this very weird issue with newly created proejct, unable to query anything.