feat(data-sources): add Cloudflare R2 SQL source#291
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
onequery-landing | 1c878ce | Commit Preview URL Branch Preview URL |
Jun 25 2026, 07:24 AM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c878ceb75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const TRANSIENT_CLOUDFLARE_R2_SQL_STATUS_CODES = new Set([ | ||
| 429, 500, 502, 503, 504, | ||
| ]); | ||
| const CONNECTION_TEST_QUERY = "SELECT 1 AS onequery_connection_test"; |
There was a problem hiding this comment.
Use a supported R2 SQL smoke query
When users run source test or click the dashboard test action for a Cloudflare R2 SQL source, this sends SELECT 1 AS onequery_connection_test to the R2 SQL endpoint. Cloudflare's R2 SQL reference documents SELECT queries as requiring FROM namespace_name.table_name (schema discovery commands such as SHOW DATABASES are separate), so valid R2 credentials can be reported as failed and the source marked error even though real table queries would work. Use a table-independent supported discovery command, or leave this provider non-testable until a table-aware smoke query is available.
Useful? React with 👍 / 👎.
One-Line Summary
Add Cloudflare R2 SQL as a queryable data source for R2 Data Catalog Iceberg tables.
User-Facing Changes
cloudflare_r2_sqlsource withaccountId,bucketName,apiToken, and optionalapiBaseUrl.SELECTqueries against Cloudflare R2 SQL and return normalized row objects.Why This Changed
R2 Data Catalog tables were not directly queryable through OneQuery. Users could store data in R2 and query it externally, but OneQuery had no provider key, credential schema, query driver, or UI metadata for Cloudflare R2 SQL.
How It Changed
CloudflareR2SqlCredentialsSchemaand registeredcloudflare_r2_sqlas a database/warehouse provider./api/v1/accounts/{accountId}/r2-sql/query/{bucketName}, sends the derived warehouse name, normalizesresult.rows, masks API tokens in errors, and supports connection testing.Bug Fixes
N/A
Performance Notes (Optional)
N/A
Extra Context / Decisions (Optional)
Verification
rtk bunx turbo test --json --filter=@onequery/db --filter=@onequery/server --filter=@onequery/cli-server --filter=@onequery/dashboard --filter=@onequery/uirtk bunx turbo check:fixrtk bunx turbo typecheck --json --filter=@onequery/db --filter=@onequery/server --filter=@onequery/cli-server --filter=@onequery/dashboard --filter=@onequery/ui --filter=@onequery/landingoxlint . --type-aware --type-checkVideo / Screenshot (Optional)