-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type error fetch failed #142
Comments
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 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
DATABASE_URL=mysql://user:[email protected]: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:
I'll open up and issue about ignoring the 3306 part since that will never work. |
right thanks a lot!, I also tried using 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 |
actually not, I used the credentials generated from pscale cli and it only included the name |
running into that issue using prisma/kysely and the planetscale cli proxy that allows me to connect to any way around it? |
getting this very weird issue with newly created proejct, unable to query anything.
The text was updated successfully, but these errors were encountered: