supavisor icon indicating copy to clipboard operation
supavisor copied to clipboard

HTTP endpoint for SQL queries

Open chasers opened this issue 2 years ago • 3 comments

Provide an HTTP endpoint to POST sql query strings (and parameters) and return results.

chasers avatar Aug 11 '23 16:08 chasers

Is it the goal to keep compatibility with libraries like neondatabase/serverless (same as you've planned for Websockets)?

daniel-xyz avatar Aug 12 '23 08:08 daniel-xyz

@daniel-xyz we are still discussing the api internally, but it's unlikely that we will maintain compatibility with the Neon approach

abc3 avatar Aug 14 '23 11:08 abc3

There's a workaround to make supavisor work with @neondatabase/serverless today:

  1. Configure your postgres URL like this: POSTGRES_URL=postgres://postgres.[project-ref]:[password]@aws-0-us-west-1.pooler.supabase.com:6543/postgres?sslmode=require?workaround=supabase-pooler.vercel (example)
  2. Create a pool and query: https://github.com/thorwebdev/supa-postgres-drizzle2/blob/tests/app/neon/page.tsx

This also works with vercel/postgres + drizzle: https://github.com/thorwebdev/supa-postgres-drizzle2/blob/tests/lib/drizzle.ts

thorwebdev avatar Dec 14 '23 06:12 thorwebdev