Migration Confirmation/Help with PlanetScale

I know I can test this myself but I want to reduce the connections to my PlanetScale database.

So, I have my main branch which has a password to it, and a development branch off of the main branch with it's own password. If I use the dev url in the migration config file and main url for the drizzle connection will this cause any issues.

Here is what I have done:
//drizzle.config.ts
import * as dotenv from 'dotenv';
import type { Config } from 'drizzle-kit';

dotenv.config();

export default {
    schema: './db/schema/*',
    driver: 'mysql2',
    out: './drizzle',
    dbCredentials: {
        uri: process.env.DATABASE_DEV_URL ?? ''
    }
} satisfies Config;

//drizzle connection
export class BaseUtility extends BaseModule {
        // cool stuff up here

    private planetScaleClient: Client = new Client({ url: process.env.DATABASE_MAIN_URL, fetch: undiciFetch });
    private planetScaleAdapter: PrismaPlanetScale = new PrismaPlanetScale(this.planetScaleClient);
    public prisma: PrismaClient = new PrismaClient({ adapter: this.planetScaleAdapter });
        // more cool stuff down here
}
Was this page helpful?