Documentation
Database ORM

Drizzle

Drizzle (opens in a new tab) is an open-source headless Typescript ORM. t’s the only ORM with both relational and SQL-like query APIs, providing you the best of both worlds when it comes to accessing your relational data.

For local server environment, we are using Drizzle in combination with Neon (opens in a new tab) which is also an open-source PostgreSQL database.

In order to setup the Drizzle ORM, you need to follow the below steps:

Setup project with Neon

Visit the Neon (opens in a new tab), sign-up, and create a new project. You will be asked to setup a Name, Postgres version, Cloud Service Provider, Region, and Compute size. You can create your own database name or use the default one. For the rest of the values, you can keep them at default. Moving onwards, you will be redirected to the Quickstart. From the Quickstart section, select Postgres, click on show password, and copy the snippet.

StudyStudio
Example for a project created on Neon dashboard.

Replacing environment variables

Replace your-neon-db-connection-string with your original Neon DB Connection String from Neon dashboard (opens in a new tab). You need to ensure you have used the same Neon DB Connection String for all of the required environment variables.

.env.local
NEXT_PUBLIC_DRIZZLE_DB_URL = your-neon-db-connection-string
DATABASE_URL = your-neon-db-connection-string

Visiting Drizzle Studio

You can use the following command to visit Drizzle studio for your project:

This completes your setup for Drizzle ORM with Neon database. You can now start using Drizzle ORM in your project.

© 2025 StudyStudio Inc. All rights reserved.