Repository navigation
KY1: the profiles table on Workers and Supabase - #2
Merged
pullely merged 1 commit intoNov 4, 2026
Merged
Conversation
vercel/examples storage/postgres-kysely (de86723) in apps/web on Next.js 16.3.8, built by @opennextjs/cloudflare into one Worker with Static Assets. Vercel Postgres becomes a Supabase project's Postgres reached through the HYPERDRIVE binding: lib/kysely.ts keeps upstream's Database types, db and sql, and db is a Proxy whose every property read resolves to the current request's Kysely client (kysely-postgres-js over postgres.js, kept in a WeakMap against the request's ExecutionContext; POSTGRES_URL without a Cloudflare context). postgres.js keeps its default type fetch: kysely-postgres-js reserves a connection per query, and postgres.js 3.4.9 never resolves a reserve on a fresh connection with fetch_types off (the spike's finding, risk KY-K). The profiles table — upstream's Kysely schema compiled — and row-level security are packages/db migrations that infra/db-migrate applies after the infra/terraform/supabase project and the infra/terraform/cloudflare-hyperdrive config exist and before the Worker deploys; lib/seed.ts keeps only its three INSERTs ON CONFLICT (email) DO NOTHING, the table seeds an empty table and reads the seed back past Hyperdrive's cache, and says when the migrations have not run; pnpm db:migrate applies the same files to a local database through Kysely's Migrator, its ledger in schema kysely. /api/health answers 200 only with the table migrated and RLS on. tests/web (the per-request client and its options, timeAgo, the table's branches, the seed, the health check, the wrangler render) and tests/db (the manifest and the local migrator's list, the table's columns and a racing seed, row-level security, on PGlite). typecheck, lint, test and build are green; wrangler dev over the build seeds and lists the three profiles from a migrated database and reports the migrations pending on a blank one; the Worker is 1.45 MiB gzipped. Co-Authored-By: Claude <noreply@anthropic.com> Orun-Task: KY-2
pullely
deleted the
orun/KY-2-the-profiles-table-on-workers-and-supabase
branch
November 4, 2026 21:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vercel/examples storage/postgres-kysely (de86723) in apps/web on Next.js 16.3.8, built by @opennextjs/cloudflare into one Worker with Static Assets. Vercel Postgres becomes a Supabase project's Postgres reached through the HYPERDRIVE binding: lib/kysely.ts keeps upstream's Database types, db and sql, and db is a Proxy whose every property read resolves to the current request's Kysely client (kysely-postgres-js over postgres.js, kept in a WeakMap against the request's ExecutionContext; POSTGRES_URL without a Cloudflare context). postgres.js keeps its default type fetch: kysely-postgres-js reserves a connection per query, and postgres.js 3.4.9 never resolves a reserve on a fresh connection with fetch_types off (the spike's finding, risk KY-K). The profiles table — upstream's Kysely schema compiled — and row-level security are packages/db migrations that infra/db-migrate applies after the infra/terraform/supabase project and the infra/terraform/cloudflare-hyperdrive config exist and before the Worker deploys; lib/seed.ts keeps only its three INSERTs ON CONFLICT (email) DO NOTHING, the table seeds an empty table and reads the seed back past Hyperdrive's cache, and says when the migrations have not run; pnpm db:migrate applies the same files to a local database through Kysely's Migrator, its ledger in schema kysely. /api/health answers 200 only with the table migrated and RLS on. tests/web (the per-request client and its options, timeAgo, the table's branches, the seed, the health check, the wrangler render) and tests/db (the manifest and the local migrator's list, the table's columns and a racing seed, row-level security, on PGlite). typecheck, lint, test and build are green; wrangler dev over the build seeds and lists the three profiles from a migrated database and reports the migrations pending on a blank one; the Worker is 1.45 MiB gzipped.
🤖 Generated with Claude Code