Glossary

Edge Function

A Supabase Edge Function is a Deno serverless function with a ~150s execution cap and IPv4-only egress, which shapes how it reaches a Postgres database.

Edge Function — a Deno-based serverless function that Supabase runs on demand, deployed from supabase/functions/ and invoked over HTTP at /functions/v1/<name>.

Two limits matter for migration work. First, execution is capped at roughly 150 seconds per invocation; anything longer is killed mid-run, so a full data or storage copy cannot live inside a single function call. Second, egress is IPv4-only. The direct database host db.<ref>.supabase.co resolves to an IPv6 address, so a connection attempt from a function fails with ENETUNREACH (see /errors/ipv6-enetunreach). To reach Postgres you connect through the IPv4 connection pooler instead:

# Fails from an Edge Function — IPv6 direct host
postgres://postgres:pw@db.abcd.supabase.co:5432/postgres

# Works — IPv4 pooler on port 6543
postgres://postgres.abcd:pw@aws-0-us-east-1.pooler.supabase.com:6543/postgres

Because of the time cap, SupaMigrate keeps heavy migration logic in the browser and uses Edge Functions only for short tasks: lightweight schema introspection, report generation, and AI advisor calls. Each returns well under the limit. Calls that write to your own project still use the service-role key, passed per request and never stored.

Related terms