Skip to content

fix(server): test R2 SQL connections with catalog metadata#292

Merged
lentil32 merged 1 commit into
mainfrom
fix/r2-sql-connection-test
Jun 25, 2026
Merged

fix(server): test R2 SQL connections with catalog metadata#292
lentil32 merged 1 commit into
mainfrom
fix/r2-sql-connection-test

Conversation

@lentil32

@lentil32 lentil32 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

One-Line Summary

Cloudflare R2 SQL data sources can be tested without sending an invalid table-less SELECT query.

User-Facing Changes

  • Creating or testing a Cloudflare R2 SQL data source no longer fails because the connection test sends the old SELECT smoke query.
  • The connection test now uses a catalog metadata command that Cloudflare R2 SQL accepts.

Why This Changed

Cloudflare R2 SQL rejects queries that do not reference a table, so the generic SELECT-based smoke test failed before Velen could save a valid data source. Catalog metadata commands are the correct lightweight path for checking credentials and warehouse reachability.

How It Changed

  • Replaced the Cloudflare R2 SQL connection test query with SHOW DATABASES.
  • Added a server test that verifies R2 SQL connection testing sends SHOW DATABASES with the expected warehouse name.

Bug Fixes

  • Under Cloudflare R2 SQL data source creation, valid credentials could still fail the connection test because the previous smoke query did not reference a table.

Verification

  • rtk bunx turbo test --filter=@onequery/server --json
  • rtk bunx turbo typecheck --filter=@onequery/server --json
  • rtk bunx turbo run //#check:fix --json
  • pre-push hook: type-aware lint passed

Video / Screenshot (Optional)

  • N/A

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
onequery-landing 2777757 Commit Preview URL

Branch Preview URL
Jun 25 2026, 08:45 AM

@lentil32 lentil32 merged commit a00637f into main Jun 25, 2026
9 checks passed
@lentil32 lentil32 deleted the fix/r2-sql-connection-test branch June 25, 2026 08:48
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.

1 participant