Skip to content

breaking-change

1 post with the tag “breaking-change”

pgflow 0.6.0: Worker Deprecation and Context Changes

pgflow 0.6.0 worker deprecation and context changes cover image

pgflow 0.6.0 introduces worker deprecation for deployments without version overlap and simplifies the context object with breaking changes.

Deploy new workers without version overlap. Deprecated workers stop accepting new tasks while finishing current work.

-- Deprecate old workers before starting new ones
UPDATE pgflow.workers
SET 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.

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('*');
}
  1. Update context usage: context.serviceSupabasecontext.supabase
  2. Remove any context.anonSupabase usage
  3. Use worker deprecation for smooth deployments

The service role client is now the primary Supabase interface, simplifying database operations in handler functions.