Getting Started
Configuration
Troubleshooting
Drizzle ORM is a lightweight and flexible tool designed to help you interact with your SQL databases using TypeScript. By handling the bridge between your code and your database, it allows you to write queries safely and efficiently without worrying about complex underlying connection logic.
To use Drizzle ORM in your project, you need to install the core package along with the specific driver required for your chosen database.
Open your terminal in your project directory and run the following command to add Drizzle ORM to your project:
npm install drizzle-ormDrizzle ORM is designed to work alongside existing database drivers. Depending on which database you are using, you must install the corresponding package.
Note
Drizzle is "database-agnostic," meaning you only need to install the driver for the specific technology you are using (such as PostgreSQL, MySQL, or SQLite).
Commonly supported drivers include:
For example, to set up a PostgreSQL project, you would install the driver like this:
npm install pgTip
If you are working in a specific environment like Cloudflare Workers or using a specialized platform like PlanetScale, check your platform's documentation to identify which specific driver package they recommend using with Drizzle.
Warning
Always ensure that the version of your database driver is compatible with the latest version of Drizzle ORM. Using outdated drivers may result in connection errors or unexpected behavior when executing queries.