Skip to content

NL1: the text-to-SQL app on Workers and Supabase - #2

Merged
pullely merged 1 commit into
mainfrom
orun/NL-2-the-text-to-sql-app-on-workers-and-supabase
Oct 28, 2026
Merged

pullely merged 1 commit into
mainfrom
orun/NL-2-the-text-to-sql-app-on-workers-and-supabase

Conversation

@pullely

@pullely pullely commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

The template in apps/web on Next.js 16.3.8 (the Cloudflare adapter refuses 15.5), built by @opennextjs/cloudflare into one Worker with Static Assets. Its four server actions are upstream's, with two changes: the model comes from lib/ai/models.ts — Workers AI's Llama 4 Scout through the AI binding, in JSON mode for the three structured outputs, or OpenAI's gpt-5.4-mini straight from OpenAI once OPENAI_API_KEY is a Worker secret (the gateway model string is gone) — and the SQL runs through lib/db.ts's runReadOnlyQuery(): app_private.run_read_only as query_reader, in a READ ONLY transaction with a 5 s statement timeout, after the template's own string check, which stays. @vercel/postgres becomes a postgres client per call over the HYPERDRIVE binding, rendered into wrangler.jsonc from the wiring document the infra/terraform/cloudflare-hyperdrive root publishes over the infra/terraform/supabase project. The table (upstream's CREATE TABLE), sixty fictional sample companies, row-level security and query_reader with its function are packages/db migrations applied by infra/db-migrate before the Worker deploys; tooling/migrations/csv-to-sql.mjs turns the owner's CB Insights CSV into one more. lib/site.ts is the name seam the layout and the header read, the source link where Vercel's deploy button was, and the origin. tests/web (the actions and the string check, the model on Workers AI through the real provider and on OpenAI, the client and the read-only path, the health check, the origin and the name) and tests/db (the manifest, the schema and the sample, row-level security, every refusal of the read-only path — writes, DDL, other schemas, a DELETE in hex, a step back up to the owner — and the CSV loader, on PGlite). typecheck, lint, test and build are green; the Worker is 1.52 MiB gzipped.

🤖 Generated with Claude Code

The template in apps/web on Next.js 16.3.8 (the Cloudflare adapter refuses 15.5), built by @opennextjs/cloudflare into one Worker with Static Assets. Its four server actions are upstream's, with two changes: the model comes from lib/ai/models.ts — Workers AI's Llama 4 Scout through the AI binding, in JSON mode for the three structured outputs, or OpenAI's gpt-5.4-mini straight from OpenAI once OPENAI_API_KEY is a Worker secret (the gateway model string is gone) — and the SQL runs through lib/db.ts's runReadOnlyQuery(): app_private.run_read_only as query_reader, in a READ ONLY transaction with a 5 s statement timeout, after the template's own string check, which stays. @vercel/postgres becomes a postgres client per call over the HYPERDRIVE binding, rendered into wrangler.jsonc from the wiring document the infra/terraform/cloudflare-hyperdrive root publishes over the infra/terraform/supabase project. The table (upstream's CREATE TABLE), sixty fictional sample companies, row-level security and query_reader with its function are packages/db migrations applied by infra/db-migrate before the Worker deploys; tooling/migrations/csv-to-sql.mjs turns the owner's CB Insights CSV into one more. lib/site.ts is the name seam the layout and the header read, the source link where Vercel's deploy button was, and the origin. tests/web (the actions and the string check, the model on Workers AI through the real provider and on OpenAI, the client and the read-only path, the health check, the origin and the name) and tests/db (the manifest, the schema and the sample, row-level security, every refusal of the read-only path — writes, DDL, other schemas, a DELETE in hex, a step back up to the owner — and the CSV loader, on PGlite). typecheck, lint, test and build are green; the Worker is 1.52 MiB gzipped.

Co-Authored-By: Claude <noreply@anthropic.com>
Orun-Task: NL-2
@pullely
pullely merged commit bb49370 into main Oct 28, 2026
2 checks passed
@pullely
pullely deleted the orun/NL-2-the-text-to-sql-app-on-workers-and-supabase branch October 28, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants