DEV Community

Anden Acitelli
Anden Acitelli

Posted on

Connect IntelliJ's database engine to Vercel Postgres

Overview

This is a nice and sweet tutorial on connecting to your Vercel Postgres database with IntelliJ's Database plugin.

I work for Akkio, where I'm building out a no-code predictive AI platform. If you're looking to harness the power of AI without needing a data scientist, give us a try!

Step 1: Create a Database

First, create a PostgreSQL database through Vercel.
Image description

This will automatically add all the relevant environment variables you'll need to the Vercel project as well, which will come in handy a bit later.

Image description

Step 2: Find Your Credentials

The way I recommend doing this is as follows.

  1. Install the Vercel CLI. npm i -g vercel should do the trick.
  2. Link your project. vercel link will walk you through the process.
  3. Pull your variables down. vercel env pull is the command you're looking for.

At this point, you'll have a .env file locally that you can use to your exact values. The relevant variables you're looking for are POSTGRES_USER, POSTGRES_HOST, POSTGRES_PASSWORD, and POSTGRES_DATABASE.

Step 3: Plug them In!

From here, create a new PostgreSQL connection in the Database plugin in IntelliJ. The screen will look like this:
Image description

Fill this in with the details from above. Hit "Test Connection" and make sure everything works!

Step 3: Plug Them In!

Top comments (0)