Drizzle Turso

Configure drizzle and turso with a single click

Usage

npx next-inject add drizzle-turso

Setup Turso

  1. Create an account with turso

  2. Install the Turso CLI by running this command:

# Will not work on Windows
curl -sSfL https://get.tur.so/install.sh | bash
For Windows Users

If you are on Windows, then you must install wsl, which is a Linux environment inside Windows.

To do this, run the following command inside a Command Prompt or Powershell terminal in Administrator Mode:

wsl --install

After running this command, boot up your Linux terminal and run the installation command specified above.

  1. Authenticate with the turso CLI by running the following command:
# I use the "--headless" option because I find that it's easier to authenticate,
# feel free to remove this option if you like.
turso auth signup --headless
  1. Create a new database using this command:
turso db create database_name
  1. Generate the required environment variables, including the Database URL and Auth Token:
# Get the "Database URL"
turso db list # copy the "URL" value for your database.
 
# Generate an "Auth Token"
turso db tokens create database_name
  1. Copy these variables into your .env.local file as follows:
.env.local
# Turso
TURSO_DATABASE_URL=DB_URL
TURSO_AUTH_TOKEN=AUTH_TOKEN
Bonus Features
Example 'users' drizzle schema

Any further questions?
Please do not hesitate to contact us by email or twitter
Also, If you are enjoying Next Inject, feel free to share a testimonial here!

On this page