feat: add LEA_DUCKDB_SECRETS, replace LEA_DUCKLAKE_SECRET#190
Merged
Conversation
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>
There was a problem hiding this comment.
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
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LEA_DUCKDB_SECRETS(semicolon-separatedCREATE SECRETbodies) that works across all DuckDB-based warehouses (DuckDB, MotherDuck, DuckLake)LEA_DUCKLAKE_SECRETandLEA_QUACK_DUCKLAKE_SECRETwithLEA_DUCKDB_SECRETSandLEA_QUACK_DUCKDB_SECRETSATTACHcan use the credentialsCloses #188
Test plan
LEA_DUCKDB_SECRETSworks withLEA_WAREHOUSE=duckdb(e.g. gsheets extension)LEA_DUCKDB_SECRETSworks with DuckLake for cloud storage (R2/S3/GCS)LEA_QUACK_DUCKDB_SECRETSworks in quack mode🤖 Generated with Claude Code
Summary by cubic
Adds
LEA_DUCKDB_SECRETS(andLEA_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 likegsheets.LEA_DUCKLAKE_SECRETwithLEA_DUCKDB_SECRETSandLEA_QUACK_DUCKLAKE_SECRETwithLEA_QUACK_DUCKDB_SECRETS.Written for commit 94a0761. Summary will update on new commits.