//how-is-this-not-illegalbyrauchg

how-is-this-not-illegal

A demo of using RSC and Vercel Postgres, legally

634
22
634
6
JavaScript

How is this not illegal

This beautiful tweet by Dan Abramov brought to life.

Dan Abramov's tweet jokingly suggesting querying Postgres directly from a React component should be illegal

Setting it up

  1. Create a Vercel Postgres database and link it to your project
  2. Go to its settings and copy the psql command
  3. Add -f sql/init.sql like so to populate the database with some data:
    psql "postgres://{user}:{password}@{name}.{location}.postgres.vercel-storage.com:5432/verceldb" -f init.sql
    
[beta]v0.14.0