Overview
Get started with database
This starter template uses Drizzle as the database. Drizzle is a lightweight, open-source database that provides a simple and efficient way to store and manage data. It's designed to be easy to use and integrate with your Next.js application.
Why Drizzle ORM?
Drizzle ORM is lightweight, type-safe, and ships with zero dependencies. It offers a SQL-first approach with seamless migrations, making database interactions simple and efficient.
For the database we're leveraging PostgreSQL, but you could use any other database that Drizzle ORM supports (basically any SQL database e.g. MySQL, SQLite, etc.).
Setup
To start interacting with the database you first need to ensure that your database instance is up and running.
Local development
- Install Docker
- Run
docker compose up -d
in the root of the project. This will start a local PostgreSQL instance. - Ensure the environment variables in your
.env
file are configured to point to your local database. The connection string is as following:
Studio
Drizzle ORM also provides you with an interactive UI where you can explore your database and test queres callded Studio
To run the Studio, you can use the following command:
This will start the Studio on https://local.drizzle.studio
.
How is this guide?