-
Notifications
You must be signed in to change notification settings - Fork 33
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
SSL wrong version number. #26
Comments
@iamtouha I forgot to add some details.
Refer to this Issue for further details. |
Hi @Fr3akyMurk , have you tried removing |
Hello, @iamtouha For some reason mysql databases My connection string looks like this, it's quite similar to planetscales url.
|
Okay so, i did some digging. More prominently, i checked the migration code and applied it to the index file. This seems to resolve the connection issues but then the code starts to complain about an await statement in a top level module. import mysql from "mysql2/promise";
//import { drizzle } from "drizzle-orm/planetscale-serverless";
import { drizzle } from "drizzle-orm/mysql2";
//import { Connection } from "@planetscale/database";
import { env } from "@/env";
import * as schema from "./schema";
//export const connection = new Connection({ url: env.DATABASE_URL });
//export const db = drizzle(connection, { schema });
const connection = await mysql.createConnection(env.DATABASE_URL);
export const db = drizzle(connection, { schema, mode: "default" }) Figured this information would be better off to be sent to you considering you made majority of the code.
|
|
That is true,
db.query() is not callable at least according to vscode.
|
dang! use await before |
Alright, i have reverted to the code that was posted. I also thought a bit about it, but it could be that the connection still fails but we don't know that because the code running fails before the connection even happens, i will have to check mysql logs if i want to know if the app even connects. |
I will try with different mysql servers. |
@Fr3akyMurk No. drizzle connects smoothly with planetscale using DB_URL |
Well yeah, and so does it with any local databases, however this time it just has issues. |
I do not understand anything with this. There is little to no documentation on this error and how to fix it. How do you develop the project? Locally or somehow in the cloud? |
@iamtouha I got a workaround, although it is most likely not ideal for use with this project. My current drizzle index code looks like this: /*
import { drizzle } from "drizzle-orm/planetscale-serverless";
import { Connection } from "@planetscale/database";
import { env } from "@/env";
import * as schema from "./schema";
export const connection = new Connection({ url: env.DATABASE_URL });
export const db = drizzle(connection, { schema });
*/
import { drizzle } from "drizzle-orm/mysql2";
import mysql from "mysql2/promise";
import { env } from "@/env";
import * as schema from "./schema";
async function connect() {
const connection = await mysql.createConnection({
host: "127.0.0.1",
user: "MariaInterface",
password: "MARIADB",
port: 3306,
database: "lucia",
});
const db = drizzle(connection, {schema, mode: "planetscale"})
return db
}
export const udb = connect(); This solves the conncetionissues, however i don't know if this would work to connect to planetscale However, now i have to go through all the code that imports db and await it. Do note that this should not be used, at least not here considering i don't know if this is compatible with planetscale or other devices, all i know is that this works for me. + i made plenty more changes in:
|
Could you please spare some time to create a PR with the changes you made? I will add these changes to a new branch so that someone facing the same problem will benefit. |
Alright, i will look into it. |
I will not add my changes, those changes are not reasonable. My edits are too dramatic for something so simple. |
Greetings,
I have an issue on my local build for development where i cannot get the application to properly connect to the DB because of a SSL issue.
I keep getting this issue at:
Problem is, this is a completely fresh clone from github, the .env is the only edited part.
How can i solve this error?
The text was updated successfully, but these errors were encountered: