Skip to content

DuckDB: tables in non-main schemas are invisible (no sidebar listing, no schema switcher) #2131

Description

@VladddOfficial

What happened?

For DuckDB connections, tables that live in any schema other than main never appear anywhere in the UI — no sidebar entry, no schema picker. A database whose base tables are in custom schemas (e.g. core.bars, meta.bar_series) looks almost empty in TablePro; only the main schema's objects are listed.

The data is still reachable by typing SELECT * FROM core.bars in the SQL editor, so this is purely a navigation/visibility gap.

Steps to reproduce

  1. Create a DuckDB file:
    CREATE SCHEMA core;
    CREATE SCHEMA meta;
    CREATE TABLE core.bars (i INTEGER);
    CREATE TABLE meta.bar_series (i INTEGER);
    CREATE TABLE main.something (i INTEGER);
  2. Open the file in TablePro.
  3. The sidebar shows only something. core.bars and meta.bar_series are not listed, and there is no schema switcher to reach them.

Expected behavior

All schemas listed (like the PostgreSQL tree), or at least a schema picker so non-main tables can be browsed.

Where it seems to go wrong

The plugin and the app-level registry disagree about whether DuckDB has schemas:

  • Plugins/DuckDBDriverPlugin/DuckDBPlugin.swift fully implements multi-schema support: it declares the .multiSchema capability, and implements fetchSchemas() / switchSchema(to:).
  • But the registry snapshot in TablePro/Core/Plugins/PluginMetadataRegistry+RegistryDefaults.swift registers DuckDB with supportsSchemaSwitching: false and databaseGroupingStrategy: .flat.
  • SchemaService trusts the registry flag: it drops the schema list (if !supportsSchemas { schemasInOrder.removeValue(...) }) and loads tables via fetchTables() with no schema argument.
  • The plugin then resolves the nil schema to its default current schema, hardcoded to "main" (_currentSchema = "main"), and lists only information_schema.tables WHERE table_schema = 'main'.

So the plugin's fetchSchemas()/switchSchema() are dead code, and everything outside main is invisible. Flipping supportsSchemaSwitching to true (or grouping hierarchically like PostgreSQL) would surface them.

Database type

DuckDB (not in the dropdown)

TablePro version

0.64.0

macOS version & chip

macOS 26.5.2 / Apple Silicon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions