github drizzle-team/drizzle-kit-mirror v0.18.0
0.18.0

latest releases: v0.21.1, v0.21.0, v0.20.18...
12 months ago

drizzle-kit@0.18.0 🎉🎉🎉

New features 🎉

New ways to define drizzle config file

You can now specify the configuration not only in the .json format but also in .ts and .js formats.


TypeScript example

import { Config } from "src";

export default {
  schema: "",
  connectionString: process.env.DB_URL,
  out: "",
  breakpoints: true
} satisfies Config;

JavaScript example

/** @type { import("drizzle-kit").Config } */
export default {
    schema: "",
  connectionString: "",
  out: "",
  breakpoints: true
};

New commands 🎉

drizzle-kit push:mysql

You can now push your MySQL schema directly to the database without the need to create and manage migration files. This feature proves to be particularly useful for rapid local development and when working with PlanetScale databases.

By pushing the MySQL schema directly to the database, you can streamline the development process and avoid the overhead of managing migration files. This allows for more efficient iteration and quick deployment of schema changes during local development.

How to setup your codebase for drizzle-kit push feature?

  1. For this feature, you need to create a drizzle.config.[ts|js|json] file. We recommend using .ts or .js files as they allow you to easily provide the database connection information as secret variables

    You'll need to specify schema and connectionString(or db, port, host, password, etc.) to make drizzle-kit push:mysql work

drizzle.config.ts example

import { Config } from "src";

export default {
  schema: "./schema.ts",
  connectionString: process.env.DB_URL,
} satisfies Config;
  1. Run drizzle-kit push:mysql

  2. If Drizzle detects any potential data-loss issues during a migration, it will prompt you to approve whether the data should be truncated or not in order to ensure a successful migration

  3. Approve or reject the action that Drizzle needs to perform in order to push your schema changes to the database.

  4. Done ✅

Don't miss a new drizzle-kit-mirror release

NewReleases is sending notifications on new releases.