Skip to content

feat: support cloudflare R2 natively#180

Merged
MaxHalford merged 12 commits intocarbonfact:mainfrom
dheerapat:feat/natively-support-cloudflare-r2
Apr 14, 2026
Merged

feat: support cloudflare R2 natively#180
MaxHalford merged 12 commits intocarbonfact:mainfrom
dheerapat:feat/natively-support-cloudflare-r2

Conversation

@dheerapat
Copy link
Copy Markdown
Contributor

@dheerapat dheerapat commented Apr 11, 2026

Natively support Cloudflare's R2


Summary by cubic

Add native Cloudflare R2 support to DuckLake and quack by configuring DuckDB secrets via env vars. Docs add r2://, examples/r2-ducklake, and support remote PostgreSQL/MySQL catalogs; quack UI now runs CREATE SECRET, and we only set the active database when the client is DuckLake.

  • Migration
    • Replace provider-specific env vars with LEA_DUCKLAKE_SECRET and LEA_QUACK_DUCKLAKE_SECRET (the body of DuckDB CREATE SECRET).

Written for commit 951e93f. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@MaxHalford
Copy link
Copy Markdown
Member

I would assume R2 is compatible with S3, so we shouldn't need specific env vars. Let me give it a try.

@dheerapat dheerapat force-pushed the feat/natively-support-cloudflare-r2 branch from 0c78e41 to 0d82670 Compare April 14, 2026 02:04
@dheerapat
Copy link
Copy Markdown
Contributor Author

@MaxHalford duckdb have specific secret type r2 to work with cloudflare so it very easy to connect via this specific secret type

@MaxHalford MaxHalford force-pushed the feat/natively-support-cloudflare-r2 branch from 88fe344 to 6f1fcfe Compare April 14, 2026 03:00
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 7 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="examples/quack/README.md">

<violation number="1" location="examples/quack/README.md:85">
P2: README shell example uses an unquoted env value with spaces, causing command parsing errors when copy-pasted.</violation>
</file>

<file name="examples/r2-ducklake/README.md">

<violation number="1" location="examples/r2-ducklake/README.md:28">
P2: README quickstart path is broken: `--scripts jaffle_shop/scripts` does not match the symlink target and repository layout, causing a non-existent scripts directory.</violation>
</file>

<file name="README.md">

<violation number="1" location="README.md:162">
P2: README shell snippets use unquoted env values with spaces, causing copy-paste commands to fail in POSIX shells.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread examples/quack/README.md Outdated
Comment thread examples/r2-ducklake/README.md Outdated
Comment thread README.md Outdated
@MaxHalford
Copy link
Copy Markdown
Member

Alright @dheerapat I've made some changes in order to support any kind of secret, not just R2 secrets. Now you can do this:

LEA_USERNAME=max
LEA_WAREHOUSE=ducklake
LEA_DUCKLAKE_CATALOG_DATABASE=metadata.ducklake
LEA_DUCKLAKE_DATA_PATH=r2://lea-demo
LEA_DUCKLAKE_SECRET=TYPE r2, KEY_ID '<key_id>', SECRET '<secret>', ACCOUNT_ID '<account_id>'

@MaxHalford MaxHalford merged commit fb135f2 into carbonfact:main Apr 14, 2026
3 checks passed
@dheerapat dheerapat deleted the feat/natively-support-cloudflare-r2 branch April 18, 2026 17:27
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