Skip to content

[R2 SQL] Document JOINs, subqueries, and multi-table queries#30826

Merged
Marcinthecloud merged 6 commits into
productionfrom
r2sql-joins
May 15, 2026
Merged

[R2 SQL] Document JOINs, subqueries, and multi-table queries#30826
Marcinthecloud merged 6 commits into
productionfrom
r2sql-joins

Conversation

@Marcinthecloud
Copy link
Copy Markdown
Contributor

@Marcinthecloud Marcinthecloud commented May 14, 2026

  • Updates SQL reference with JOIN clause, subquery syntax, and multi-table CTE examples
  • Removes single-table restrictions from limitations page and adds join best practices
  • Replaces "unsupported JOIN/subquery" troubleshooting with join performance guidance
  • Adds changelog entry

Documentation checklist

@github-actions
Copy link
Copy Markdown
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners
/src/content/docs/r2-sql/ @Marcinthecloud, @netgusto, @sesteves, @sejoker, @laplab, @jonesphillip, @elithrar, @jonathanc-n, @cloudflare/product-owners

@Marcinthecloud
Copy link
Copy Markdown
Contributor Author

/bonk review this draft pr and ensure:

changes and examples are consistent, clear, and concise
no broken links anywhere
fix trivial issues and make suggestions on the PR
please don't change anything in files outside of this PR this time

@ask-bonk ask-bonk Bot added the documentation Documentation edits label May 14, 2026
Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Posted 2 inline suggestions.

Issues

  • MEDIUM src/content/docs/r2-sql/reference/limitations-best-practices.mdx:38 — The "Multi-table CTEs" row duplicates the CTEs entry directly above it. Remove it.
  • LOW src/content/docs/r2-sql/reference/limitations-best-practices.mdx:35 — "Semi-join" and "anti-join" should be lowercase to match the other Notes cells, which are sentence fragments.

Out-of-scope note

src/content/docs/r2-sql/troubleshooting.mdx:20 — The expected exactly 1 table in FROM clause error message may be misleading now that JOINs are supported. Consider verifying whether this error still occurs or updating the description in a follow-up.

Comment thread src/content/docs/r2-sql/reference/limitations-best-practices.mdx Outdated
Comment thread src/content/docs/r2-sql/reference/limitations-best-practices.mdx Outdated
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 14, 2026

Review posted on PR #30826.

Summary of changes
The PR documents newly supported multi-table query capabilities in R2 SQL across 4 files:

  • Changelog entry announcing JOINs, subqueries, and multi-table CTEs with examples
  • SQL reference adds full JOIN clause documentation, subquery syntax (IN/NOT IN, EXISTS/NOT EXISTS, scalar, derived tables), multi-table CTE examples, and self-joins
  • Limitations and best practices removes single-table restrictions and adds join performance guidance
  • Troubleshooting replaces unsupported JOIN/subquery errors with performance optimization guidance

Actions taken

  • Added the documentation label to the PR
  • Posted a review with 2 inline suggestions:
    1. MEDIUM: Remove the redundant "Multi-table CTEs" row in the quick reference table since the "CTEs" row already covers multi-table capabilities
    2. LOW: Lowercase "semi-join" and "anti-join" in the Notes column to match the sentence-fragment style of other cells
  • Flagged an out-of-scope pre-existing issue: the expected exactly 1 table in FROM clause error message in the troubleshooting page may be outdated now that JOINs are supported

No build-breaking issues (unescaped MDX, invalid frontmatter, broken links) were found.

github run

Marcinthecloud and others added 2 commits May 14, 2026 09:43
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
@Marcinthecloud Marcinthecloud marked this pull request as ready for review May 14, 2026 16:44
Comment thread src/content/docs/r2-sql/sql-reference/index.mdx Outdated
Comment thread src/content/docs/r2-sql/sql-reference/index.mdx
Comment thread src/content/docs/r2-sql/reference/limitations-best-practices.mdx Outdated
Comment thread src/content/changelog/r2-sql/2026-05-14-joins-subqueries-multi-table-queries.mdx Outdated
@Marcinthecloud Marcinthecloud merged commit 8ca0bb6 into production May 15, 2026
15 checks passed
@Marcinthecloud Marcinthecloud deleted the r2sql-joins branch May 15, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants