Skip to content

engine: let infoctl query list tables with show tables #97

Open

Description

@codecapo

infoctl query gives an analyst no way to see what is in the warehouse. The query session is a plain SessionContext::new() (crates/engine/src/lib.rs:28 at b3017eb on PR #46's branch), so DataFusion's information_schema is off, and show tables, show columns from ready.daily_revenue and select * from information_schema.tables all fail with "not supported unless information_schema is enabled" or "not found". The only listing today is the error for an unknown table, which names the tables that exist. Turn the schema on with SessionConfig::new().with_information_schema(true) when the context is built; it adds read-only virtual tables and changes nothing about the SQLOptions guard, which keeps rejecting writes. Because every layer is registered twice, under its namespace and its alias (gold and ready), each table will appear twice; either keep both rows and say so in the usage text, or hide the alias schemas from the listing. #95 (the QueryContext) must keep the setting when it rebuilds the session.

Crates: crates/engine (src/lib.rs and tests/query.rs), crates/cli (USAGE in src/lib.rs if the usage text changes)

Done when

  • show tables through infostash_engine::query returns a row for daily_revenue, and infoctl query "show tables" prints it and exits 0; the decision about the duplicate alias rows is written in the usage text or the code.
  • show columns from ready.daily_revenue returns the table's columns and types.
  • select table_schema, table_name from information_schema.tables where table_schema = 'gold' returns the table.
  • The existing tests for rejected writes still pass.
  • Each case above is a test that fails when with_information_schema(true) is removed.

Points: 1

Depends on: #15
Blocks: nothing

Source: review of PR #46, 2026-11-09.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions