pgflow 0.6.0: Worker Deprecation and Context Changes
pgflow 0.6.0 introduces worker deprecation for deployments without version overlap and simplifies the context object with breaking changes.
Worker Deprecation
Section titled “Worker Deprecation”Deploy new workers without version overlap. Deprecated workers stop accepting new tasks while finishing current work.
-- Deprecate old workers before starting new onesUPDATE pgflow.workersSET deprecated_at = NOW()WHERE function_name = 'your-worker-name' AND deprecated_at IS NULL;Workers detect deprecation within 5 seconds via heartbeat and gracefully stop polling. The deployment guide has been simplified with a single safe deployment sequence.
Breaking Context Changes
Section titled “Breaking Context Changes”The context object is now cleaner and more consistent:
Before (0.5.x):
async function handler(input, context) { const { data } = await context.serviceSupabase .from('users') .select('*');}After (0.6.0):
async function handler(input, context) { const { data } = await context.supabase .from('users') .select('*');}Migration
Section titled “Migration”- Update context usage:
context.serviceSupabase→context.supabase - Remove any
context.anonSupabaseusage - Use worker deprecation for smooth deployments
The service role client is now the primary Supabase interface, simplifying database operations in handler functions.