Skip to content

duckdb: Show catalog (database) where applicable (e.g. Motherduck)#7599

Merged
wlach merged 3 commits intogetredash:masterfrom
wlach:show-database-name-in-duckdb-if-applicable
Jan 4, 2026
Merged

duckdb: Show catalog (database) where applicable (e.g. Motherduck)#7599
wlach merged 3 commits intogetredash:masterfrom
wlach:show-database-name-in-duckdb-if-applicable

Conversation

@wlach
Copy link
Copy Markdown
Contributor

@wlach wlach commented Jan 2, 2026

What type of PR is this?

  • Bug Fix
  • Refactor
  • Feature
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

This PR fixes the DuckDB query runner's schema browser to properly display database/catalog names when using MotherDuck or attached databases.

When connecting to MotherDuck (e.g., using md:?motherduck_token={access_token}), the schema browser was only showing schema.table (e.g., kaggle.movies) instead of the full three-part name database.schema.table (e.g., sample_data.kaggle.movies). Updated the schema retrieval query to include table_catalog from information_schema.tables and construct the full table name accordingly.

The implementation handles two use cases:

  • Local databases (memory, temp, system): Continue to show 2-part names like main.users to avoid unnecessary clutter
  • MotherDuck/attached databases: Shows 3-part names like sample_data.kaggle.movies to properly distinguish between databases

Compatible with all DuckDB versions that support the information_schema.tables view with table_catalog column (including the version currently used by redash).

Implementation note: the code (and parts of this pull request description) were written by Claude 4.5 Sonnet, with human intervention and review.

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

Unit Tests Added:

  • test_motherduck_catalog_included: Verifies that non-default catalogs include the catalog name in table names
  • Updated existing tests to include table_catalog field in mock data

Manual Testing:

  • Tested with MotherDuck connection using md:?motherduck_token={access_token}
  • Verified schema browser shows full database names (e.g., sample_data.kaggle.movies)
  • Verified local DuckDB databases continue to show clean 2-part names (e.g., main.users)
  • Confirmed queries execute correctly against both MotherDuck and local databases

Related Tickets & Documents

N/A

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

No UI changes but FWIW here's a screenshot of the support using a connection to Motherduck and its default sample data:

image

Copy link
Copy Markdown
Contributor

@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 2 files

@wlach wlach enabled auto-merge (squash) January 4, 2026 16:19
@wlach wlach merged commit 45bc24a into getredash:master Jan 4, 2026
11 checks passed
woogakoki added a commit to wooga/redash that referenced this pull request Feb 25, 2026
* master: (69 commits)
  Update Python version to 3.13 (getredash#7636)
  Update plotly.js to 3.3.1, react-pivottable to 0.11.0 (getredash#7634)
  Add charset option to RDS MySQL datasource (getredash#7616)
  Aggregate y value for same x (getredash#7631)
  fix(mysql): Change default charset to utf8mb4 (getredash#7615)
  Update packages for compatibility with setuptools 82 (getredash#7622)
  Snapshot: 26.02.0-dev
  chore: support ipv6 for server in docker (getredash#7596)
  Add impersonation option in trino datasource (getredash#7605)
  Fix Elasticsearch connector configuration key mismatch (getredash#7607)
  duckdb: Show catalog (database) where applicable (e.g. Motherduck) (getredash#7599)
  Snapshot: 26.01.0-dev
  Feature/catch notsupported exception (getredash#7573)
  Multi-org: format base path, not including protocol (getredash#7260)
  fix(destinations): Handle unicode characters in webhook notifications (getredash#7586)
  Persist updated values and apply saved dashboard parameters (getredash#7570)
  Add ibm-db package to enable DB2 as datasource: (getredash#7581)
  Snapshot: 25.12.0-dev
  PostgreSQL: allow connection parameters to be specified (getredash#7579)
  Add lineShape option for Line and Area charts (getredash#7582)
  ...
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