All official Supabase client libraries now automatically retry failed database queries when they encounter transient network errors — no code changes required.
What changed#
When a GET or HEAD request to PostgREST fails with a transient error (HTTP 520, HTTP 503, or a network-level failure), the client transparently retries the request up to 3 times with exponential backoff (1s → 2s → 4s, capped at 30s). Each retry includes an X-Retry-Count header so server-side logs can observe retry behavior.
Only idempotent methods (GET and HEAD) are retried. POST, PATCH, PUT, and DELETE requests are never retried automatically.
Versions#
| Library | Version |
|---|---|
| supabase-js | v2.102.0 |
| supabase-swift | v2.43.0 |
| supabase-flutter (postgrest_dart) | v2.7.0 (supabase_flutter v2.12.2+) |
| supabase-py | v2.29.0 |
Configuration#
Retries are enabled by default. You can opt out globally or per-request:
JavaScript
_10// Disable globally_10const supabase = createClient(url, key, {_10 db: { retryEnabled: false }_10})_10_10// Disable per request_10const { data } = await supabase.from('table').select().retry(false)
Swift
_10// Disable globally_10let client = PostgrestClient(url: url, headers: headers, retryEnabled: false)_10_10// Disable per request_10let data = try await client.from("table").select().retry(enabled: false).execute()
Flutter/Dart
_10// Disable globally_10final client = PostgrestClient(url, retryEnabled: false);_10_10// Disable per request_10final data = await supabase.from('table').select().retry(enabled: false);
Python
_10# Disable per request_10data = supabase.table("table").select("*").retry(False).execute()