Skip to content

feat: add LEA_DUCKDB_SECRETS, replace LEA_DUCKLAKE_SECRET#190

Merged
MaxHalford merged 2 commits into
mainfrom
feat/duckdb-secrets
May 4, 2026
Merged

feat: add LEA_DUCKDB_SECRETS, replace LEA_DUCKLAKE_SECRET#190
MaxHalford merged 2 commits into
mainfrom
feat/duckdb-secrets

Conversation

@MaxHalford
Copy link
Copy Markdown
Member

@MaxHalford MaxHalford commented May 4, 2026

Summary

  • Adds LEA_DUCKDB_SECRETS (semicolon-separated CREATE SECRET bodies) that works across all DuckDB-based warehouses (DuckDB, MotherDuck, DuckLake)
  • Replaces the DuckLake-specific LEA_DUCKLAKE_SECRET and LEA_QUACK_DUCKLAKE_SECRET with LEA_DUCKDB_SECRETS and LEA_QUACK_DUCKDB_SECRETS
  • Moves extension/secret loading before warehouse-specific setup so DuckLake ATTACH can use the credentials
  • Bumps version to 0.19.0

Closes #188

Test plan

  • Verify LEA_DUCKDB_SECRETS works with LEA_WAREHOUSE=duckdb (e.g. gsheets extension)
  • Verify LEA_DUCKDB_SECRETS works with DuckLake for cloud storage (R2/S3/GCS)
  • Verify multiple semicolon-separated secrets are created
  • Verify LEA_QUACK_DUCKDB_SECRETS works in quack mode

🤖 Generated with Claude Code


Summary by cubic

Adds LEA_DUCKDB_SECRETS (and LEA_QUACK_DUCKDB_SECRETS) to create DuckDB secrets across DuckDB, MotherDuck, and DuckLake using semicolon-separated CREATE SECRET bodies. Extensions and secrets now load before warehouse setup so DuckLake ATTACH can use the credentials; docs and examples updated; enables auth for extensions like gsheets.

  • Migration
    • Replace LEA_DUCKLAKE_SECRET with LEA_DUCKDB_SECRETS and LEA_QUACK_DUCKLAKE_SECRET with LEA_QUACK_DUCKDB_SECRETS.
    • Breaking change in v0.19.0.

Written for commit 94a0761. Summary will update on new commits.

Introduce LEA_DUCKDB_SECRETS (and LEA_QUACK_DUCKDB_SECRETS for quack
mode) to support DuckDB CREATE SECRET statements across all DuckDB-based
warehouses, not just DuckLake. Multiple secrets can be semicolon-separated.

This replaces the DuckLake-specific LEA_DUCKLAKE_SECRET and
LEA_QUACK_DUCKLAKE_SECRET variables with a general-purpose mechanism
that works for DuckDB, MotherDuck, and DuckLake alike — enabling
extensions like gsheets that require authentication.

Extensions and secrets are now loaded before the warehouse-specific
setup so that e.g. DuckLake ATTACH can use the credentials.

Closes #188

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 issue found across 8 files

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="README.md">

<violation number="1" location="README.md:130">
P2: Quote the `LEA_DUCKDB_SECRETS` value in the shell example; without quotes, the assignment is parsed incorrectly and users will copy a broken config.</violation>
</file>
Architecture diagram
sequenceDiagram
    participant User as CLI / Env
    participant Cond as Conductor / CLI logic
    participant DB as DuckDB Client (Conn)
    participant Cloud as Cloud Provider (S3/R2/GCS)

    Note over User,DB: Session Preparation Flow

    User->>Cond: Run command (e.g., run, quack-ui)
    Cond->>User: Get LEA_DUCKDB_EXTENSIONS
    
    loop For each Extension
        Cond->>DB: INSTALL/LOAD extension
    end

    Note right of Cond: CHANGED: Secrets now loaded before warehouse ATTACH

    User->>Cond: NEW: Get LEA_DUCKDB_SECRETS (or LEA_QUACK_DUCKDB_SECRETS)
    
    loop NEW: For each semicolon-separated secret
        Cond->>Cond: Strip whitespace and wrap in CREATE SECRET ()
        Cond->>DB: execute("CREATE SECRET (...)")
        DB-->>Cloud: Validate credentials (if applicable)
    end

    alt Warehouse is DuckLake
        Cond->>DB: CHANGED: ATTACH 'ducklake:...'
        Note right of DB: This now successfully uses the<br/>secrets created in the previous step
    else Warehouse is DuckDB
        Cond->>DB: Use local database path
    else Warehouse is MotherDuck
        Cond->>DB: Set active database
    end

    Cond->>DB: Create schemas and prepare tables
    DB-->>Cond: Session Ready
    Cond-->>User: Execution started
Loading

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 README.md Outdated
@MaxHalford MaxHalford merged commit 28c14dc into main May 4, 2026
2 checks passed
@MaxHalford MaxHalford deleted the feat/duckdb-secrets branch May 4, 2026 20:09
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.

Enable "Create secret" Statement for LEA_WAREHOUSE=duckdb

1 participant