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
Release 0.28.0 Release Notes [2] show the following to connect.
import { drizzle } from 'drizzle-orm/mysql2';
import mysql from 'mysql2/promise';
import * as schema from './schema';
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Docs and release notes show two ways of connecting. Is one more right that the other?
Docs [1] show the following to connect.
import { drizzle } from "drizzle-orm/planetscale-serverless";
import { connect } from "@planetscale/database";
const connection = connect({
host: process.env["DATABASE_HOST"],
username: process.env["DATABASE_USERNAME"],
password: process.env["DATABASE_PASSWORD"],
});
const db = drizzle(connection);
Release 0.28.0 Release Notes [2] show the following to connect.
import { drizzle } from 'drizzle-orm/mysql2';
import mysql from 'mysql2/promise';
import * as schema from './schema';
const connection = await mysql.createConnection({
uri: process.env.PLANETSCALE_DATABASE_URL,
});
const db = drizzle(connection, { schema, mode: 'planetscale' });
[1] https://orm.drizzle.team/docs/installation-and-db-connection/mysql/planetscale
[2] https://github.com/drizzle-team/drizzle-orm/releases/tag/0.28.0
Beta Was this translation helpful? Give feedback.
All reactions