Skip to content

Support system.tables queries when scoped to a database #27205

@hiltontj

Description

@hiltontj

Problem

The system.tables table can only be queried on the _internal database, e.g.,

influxdb3 query --database _internal "select * from system.tables where database_name = '<db_name>'"

but not,

influxdb3 query --database <db_name> "select * from system.tables"

Proposed solution

  • Allow system.tables to be queried when scoped to a database, as in the above example.
  • Only tables from within the scoped database should be returned in the query results.

Additional context

You can see where the tables system table is currently being added to the SystemTablesProvider here:

tables.insert(
TABLES_TABLE_NAME,
Arc::new(SystemTableProvider::new(Arc::new(TablesTable::new(
Arc::clone(&catalog),
)))),
);

But that is only when the query is against the _internal database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions