You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings.
As you may already know, i have been battling with drizzle, mysql and planetscale, where most of the issues came from SSL errors.
I have found my solution to my problem.
I found out that planetscale uses HTTP / HTTPS to connect to instances, something planetscale supports but not something standard mysql servers do.
so this is my new index.ts file in drizzle that works.
import{drizzle}from"drizzle-orm/mysql2";importmysqlfrom'mysql2';// Create a MySQL connection pool (synchronous operation)/*Some options include: host: process.env["DATABASE_HOST"], user: process.env["DATABASE_USERNAME"], password: process.env["DATABASE_PASSWORD"], database: process.env["DATABASE_NAME"],*/import{env}from"@/env";import*asschemafrom"./schema";constpool=mysql.createPool({uri: 'mysql://root:MARIADB@localhost:3306/lucia',waitForConnections: true,connectionLimit: 10,queueLimit: 0});exportconstdb=drizzle(pool,{ schema,mode: "default"});
I do not care about the connection URI, it's local.
The text was updated successfully, but these errors were encountered:
Greetings.
As you may already know, i have been battling with drizzle, mysql and planetscale, where most of the issues came from SSL errors.
I have found my solution to my problem.
I found out that planetscale uses HTTP / HTTPS to connect to instances, something planetscale supports but not something standard mysql servers do.
so this is my new index.ts file in drizzle that works.
I do not care about the connection URI, it's local.
The text was updated successfully, but these errors were encountered: