PostgREST 9
PostgREST 9 adds inner-join resource embedding via the `!inner` keyword, so top-level rows can be filtered by conditions on an embedded table (e.g. messages filtered by users.username). Functions can now accept a single unnamed JSON parameter, which lets webhooks such as Postmark bounce notifications POST raw payloads straight to an rpc endpoint. PostgreSQL 14 compatibility forced a breaking change: per-claim and per-header settings are replaced by `request.jwt.claims` and `request.headers` JSON settings, so custom auth functions must be updated. Supabase's built-in auth helpers already handle this.
Related posts
- PostgREST 11 pre-release
Supabase mediumAdeptPostgREST 11's pre-release, available through the Supabase CLI, adds three querying features. A spread operator (`...table(cols)`) flattens embedded related-table columns into the parent object. Ordering by a related table's column is now supported, as are anti-joins via `is.null` filters on embedded resources. Spread and related ordering work only for one-to-one and many-to-one relationships for now. A `not.is.null` filter provides a more flexible alternative to the `!inner` modifier because it can be combined with `or` filters.
- PostgREST 13
Supabase mediumAdeptPostgREST 13 adds spread syntax for to-many relationships so one-to-many and many-to-many joins can be returned as flat JSON arrays, automatic to_tsvector conversion that enables full text search on text and json/jsonb columns (backed by a GIN index on the expression), and a maxAffected limit that throws an error when an update, delete or rpc touches too many rows. For observability, responses now carry Content-Length and a Proxy-Status header with the PostgREST error code. Breaking changes: JWT kid claims are validated against the configured JWKS, and schemas in db-schemas and db-extra-search-path must exist, so schema drops should update the search path in the same transaction.
- What is new in PostgREST v11.1?
Supabase mediumAdeptPostgREST 11.1 lets impersonated JWT roles (anon, authenticated, service_role) carry Postgres settings via ALTER ROLE ... SET, applied after a NOTIFY pgrst 'reload config'. That enables per-role statement_timeout and pg_plan_filter cost limits, where the cost limit rejects expensive queries at planning time but needs careful tuning. Transaction isolation is now configurable per function or role, alongside bulk JSON inserts that respect column defaults and new any/all filter modifiers. Breaking changes from v10 are small: the Range header is ignored on non-GET requests and Prefer: params=multiple-objects is dropped for RPC, and usage logs show almost no projects relied on either.
- supabase-js v2
Supabase mediumAdeptsupabase-js v2 brings incremental quality-of-life changes over v1. Types are now generated from the database via the CLI and set once on the client. signIn() is split into signInWithPassword() and signInWithOtp(), server-side auth moves to auth.admin, and the auth library is now async to fix a multi-tab token refresh race condition that logged users out. insert/update/upsert no longer return data unless select() is appended, which avoids surprise failures under Row Level Security. Constructor config is scoped per sub-library, each sub-library gets typed errors, Edge Function invocations auto-detect content type, and a new channel() API replaces from().on() for realtime and Postgres change subscriptions. v1 gets security and maintenance patches for three months.
- Supabase Auth: Identity Linking, Hooks, and HaveIBeenPwned integration
Supabase mediumAdeptSupabase Auth adds four features: manual Identity Linking via linkIdentity()/unlinkIdentity() for OAuth identities, session controls (time-boxed sessions, inactivity timeouts, single session per user on Pro and above), leaked password protection using the HaveIBeenPwned Pwned Passwords API with configurable password requirements, and Auth Hooks. Auth Hooks are Postgres functions that run synchronously at points such as access token generation, MFA verification and password verification, so they can add custom JWT claims or enforce custom security rules. Webhook-based hooks via Standard Webhooks are planned for Q1 2024. The GoTrue fork is also being renamed to Auth, with no breaking changes.