inian / react-postgres-components

An experiment on deploying remote functions that run inside Postgres using v8

Home Page:https://react-postgres-components.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-postgres-components

An experiment on deploying remote functions that run inside Postgres using v8, run React SSR, and are easily defined in a rpc/ directory.

export default function helloWorld () => {
  const [{version}] = sql`SELECT version()`; // no `await` needed!
  return <h1>Hello from <em>inside</em> Postgres: {version}</h1>;
}

Check out the demos & how it works.

Deployment

  • Make sure the Vercel project is connected to a Vercel Postgres (Neon) database.
  • Deploy!

Local dev

  • Run vc env pull to get a .env.local file with the POSTGRES_URL credential
  • Run pnpm dev to start developing

License & Credit

About

An experiment on deploying remote functions that run inside Postgres using v8

https://react-postgres-components.vercel.app


Languages

Language:TypeScript 81.3%Language:JavaScript 15.9%Language:CSS 2.8%