Files
HKSingleParty/99_references/supabase-examples/edge-functions/supabase/functions/postgres-on-the-edge
2025-05-28 09:55:51 +08:00
..
2025-05-28 09:55:51 +08:00
2025-05-28 09:55:51 +08:00
2025-05-28 09:55:51 +08:00

postgres-on-the-edge

This function allows you to access your Supabase database directly via TCP from an edge function.

You can add a global cache to your database for fast access to your data, globally by simply connecting your Supabase database to PolyScale.

Setup

  1. Rename .env.example to .env
  2. Insert Supabase database connection string for DATABASE_URL in .env file
  3. Replace DATABASE_URL with PolyScale connection string.

Deploy

  1. Run supabase functions deploy --no-verify-jwt postgres-on-the-edge
  2. Run supabase secrets set --env-file supabase/functions/postgres-on-the-edge/.env

Learn more about creating this function here.