Calendars in Postgres using Foreign Data Wrappers
A Cal.com Foreign Data Wrapper, built on Supabase's Wasm-based Wrappers framework, lets Postgres read Cal.com event types and bookings and create bookings with a plain INSERT, so a signup and its calendar booking can happen in one transaction. Setup has three steps: enable the wrappers extension, create a wasm_wrapper foreign server pointing at the Cal.com FDW package with an API key, and define foreign tables whose single jsonb attrs column holds the API objects. Data is extracted with JSON operators and json_array_elements. Inserts require the rowid_column option on the bookings table.
Related posts
- Supabase Wrappers, a Postgres FDW framework written in Rust
Supabase mediumAdeptSupabase Wrappers is an alpha Rust framework, built on pgx, for writing Postgres Foreign Data Wrappers that expose external systems such as Stripe and Firebase as queryable foreign tables. A worked example connects a Stripe account, maps products to a foreign table and queries it with SQL or the Supabase JS client. Wrappers also support a "QETL" (query, extract, transform, load) pattern: query warehouses like Snowflake on demand, join remote data with local tables, and materialize results with pg_cron. The framework adds async support for REST-API-backed FDWs and early push-down support, with ClickHouse, BigQuery and Airtable wrappers in development.
- Postgres Foreign Data Wrappers with Wasm
Supabase mediumAdeptSupabase Wrappers, a Rust framework for building Postgres Foreign Data Wrappers, now supports WebAssembly FDWs that are downloaded from URLs like GitHub or S3, checksum-verified, cached and run in a sandboxed Wasm runtime inside the Postgres extension. The host extension provides the runtime, an HTTP interface and utilities, while each guest FDW fetches data from HTTP JSON APIs. TCP-based databases and local files are not yet supported. Snowflake and Paddle Wasm FDWs ship built in, a SQL walkthrough shows creating a Paddle server and foreign table, and wrappers from untrusted sources should never be installed.
- Supabase Wrappers v0.2: Query Pushdown & Remote Subqueries
Supabase mediumAdeptSupabase Wrappers v0.2, a Rust-based Postgres foreign data wrapper framework for querying third-party sources with SQL, adds query pushdown, remote subqueries and per-FDW usage statistics. Pushdown is implemented inside each wrapper, so a filter on a Stripe customer id becomes a single API call and ClickHouse queries can push down ORDER BY and LIMIT. Remote subqueries map a static query, or a parameterized ClickHouse/BigQuery view whose parameters are exposed as columns, onto a foreign table. A new wrappers_fdw_stats table records rows and bytes transferred in each direction for spotting bottlenecks, and the release also adds Airtable and S3 wrappers.
- Cal.com launches Expert Marketplace built with Next.js and Supabase.
Supabase mediumAdeptCal.com's open-source Platform Starter Kit for building expert marketplaces runs on Next.js and Supabase, having switched from SQLite to Postgres via Prisma shortly before launch once file storage was needed. Prisma connects through Supavisor using a pooled transaction-mode URL plus a direct session-mode URL, and its multiSchema feature keeps app tables out of the PostgREST-exposed public schema. Profile images upload to Supabase Storage via server-generated signed upload URLs, which works alongside Auth.js rather than Supabase Auth, and a custom Next.js Image loader serves resized images. A Vercel integration syncs environment variables and can provision a project with migrations and seeds in one click.
- Sync Stripe Data to Your Supabase Database in One Click
Supabase mediumAdeptSupabase now offers a one-click Stripe Sync Engine integration that copies Stripe customers, subscriptions, invoices and payments into real Postgres tables, kept current via webhooks plus scheduled backfills run through pgmq-based Supabase Queues and Edge Functions with retries. Unlike the existing Stripe Foreign Data Wrapper, which translates each query into Stripe API calls and slows down or hits rate limits on joins and aggregations, the sync engine lets queries run against local indexed data. Example SQL shows finding unconverted signups, computing MRR by plan, and spotting inactive paying accounts. Stripe contributed JSONB storage with generated columns, cursor-based incremental sync, Connect multi-account support and a CLI to the open-source engine.