Shape / inspect · All operations
List tables and other catalog objects
A variant of List columns and types
List the databases, schemas, tables, views, functions or types a connection or session holds.
Status
- In arcform
Runs as a SQL step
arcform carries it as a
sql:step today.
The DuckDB step
List the databases, schemas, tables, views, functions and types a session holds
It reads the orders table the proofs share. Create it first:
CREATE TABLE orders AS SELECT * FROM (VALUES
(1, 'Alice Ng', 'north', DATE '2026-01-03', 120.00, 'widget', 'a|b', '{"channel":"web","items":[1,2]}'),
(2, 'alice ng', 'north', DATE '2026-01-05', 80.50, 'gadget', 'b', '{"channel":"shop","items":[3]}'),
(3, 'Bob Okafor', 'south', DATE '2026-01-05', 300.00, 'widget', 'a|c', '{"channel":"web","items":[4,5,6]}'),
(4, 'Carla Díaz', 'east', DATE '2026-01-09', NULL, 'gizmo', NULL, '{"channel":"web","items":[]}'),
(5, 'Bob Okafor', 'south', DATE '2026-01-12', 45.25, 'gadget', 'c', '{"channel":"phone","items":[7]}'),
(6, 'Dev Patel', 'west', DATE '2026-01-12', 510.00, 'widget', 'a', '{"channel":"web","items":[8,9]}'),
(7, 'Carla Diaz', 'east', DATE '2026-01-20', 99.99, 'gizmo', 'b|c', '{"channel":"shop","items":[10]}'),
(8, 'Dev Patel', 'west', DATE '2026-02-02', 510.00, 'widget', 'a', '{"channel":"web","items":[8,9]}'),
(9, 'Eve Larsen', NULL, DATE '2026-02-03', 15.00, 'gadget', NULL, '{"channel":"web","items":[11]}'),
(10, 'Alice Ng', 'north', DATE '2026-02-10', 220.00, 'gizmo', 'a|b|c', '{"channel":"phone","items":[12,13]}')
) t(order_id, customer, region, order_date, amount, product, tags, meta);Then run the statement:
CREATE SCHEMA staging;
CREATE TABLE staging.events (id INTEGER);
CREATE VIEW order_totals AS SELECT customer, sum(amount) AS total FROM orders GROUP BY customer;
CREATE TYPE region_name AS ENUM ('north', 'south');
CREATE MACRO double_it(x) AS x * 2;
CREATE TEMP TABLE databases AS SELECT database_name FROM duckdb_databases() WHERE NOT internal;
CREATE TEMP TABLE schemas AS
SELECT schema_name FROM duckdb_schemas() WHERE database_name = current_database() AND schema_name NOT IN ('information_schema', 'pg_catalog');
CREATE TEMP TABLE tables AS
SELECT schema_name, table_name FROM duckdb_tables() WHERE database_name = current_database() AND NOT internal;
CREATE TEMP TABLE views AS
SELECT schema_name, view_name FROM duckdb_views() WHERE database_name = current_database() AND NOT internal;
CREATE TEMP TABLE functions AS
SELECT function_name, function_type FROM duckdb_functions() WHERE function_name = 'double_it';
CREATE TEMP TABLE types AS
SELECT type_name, logical_type FROM duckdb_types() WHERE database_name = current_database() AND NOT internal;
SELECT schema_name, table_name FROM tables ORDER BY ALL;
SELECT schema_name, view_name FROM views ORDER BY ALL;
SELECT CASE WHEN ((SELECT count(*) FROM databases WHERE database_name = current_database()) = 1 AND (SELECT list(schema_name ORDER BY schema_name) FROM schemas) = ['main', 'staging'] AND (SELECT list((schema_name, table_name) ORDER BY schema_name, table_name) FROM tables) = [('main', 'customers'), ('main', 'orders'), ('main', 'prices'), ('staging', 'events')] AND (SELECT list((schema_name, view_name)) FROM views) = [('main', 'order_totals')] AND (SELECT list((function_name, function_type)) FROM functions) = [('double_it', 'macro')] AND (SELECT list((type_name, logical_type)) FROM types) = [('region_name', 'ENUM')]) THEN 'as expected' ELSE error('the catalog did not list the three fixture tables and staging.events, the order_totals view, the double_it macro and the region_name type') END AS verdict;- It needs nothing installed beyond DuckDB itself.
- The statement checks its own result and raises an error when it is wrong: “the catalog did not list the three fixture tables and staging.events, the order_totals view, the double_it macro and the region_name type”.
- It passed on DuckDB
v2.0.0 (Cyanoptera) d54cbbe3df.
What other tools call it
Meridian's classification; an independent blind rating agreed on 95.7% of 324 rows (variant, version 3).
Apache DataFusion (4)
Basic SQL Information Schema (TABLES, VIEWS, COLUMNS)read 2026-09-27Query catalog metadata through information_schema views
SHOW CREATE TABLE <view>read 2026-09-27Show the statement that defines a view
SHOW FUNCTIONSread 2026-09-27List available functions with their parameters and descriptions
SHOW TABLESread 2026-09-27List tables in the catalog
Apache Hop (2)
Get table namesread 2026-09-27List the schemas, tables, views, procedures and synonyms of a database connection
JDBC Metadataread 2026-09-27Fetch catalogs, schemas, tables, columns and keys through JDBC metadata calls
dbt-utils (2)
get_relations_by_patternread 2026-09-27Return the relations whose schema and table names match LIKE patterns
get_relations_by_prefixread 2026-09-27Return the relations in a schema whose names start with a prefix (to be deprecated)
DuckDB (8)
SHOW and SHOW DATABASESread 2026-09-27List tables, databases, or a table's columns
duckdb_coordinate_systemsread 2026-09-27duckdb_coordinate_systems table function
duckdb_databasesread 2026-09-27duckdb_databases table function
duckdb_schemasread 2026-09-27duckdb_schemas table function
duckdb_sequencesread 2026-09-27duckdb_sequences table function
duckdb_tablesread 2026-09-27duckdb_tables table function
duckdb_typesread 2026-09-27duckdb_types table function
duckdb_viewsread 2026-09-27duckdb_views table function
Pentaho Data Integration (2)
Get table namesread 2026-09-27List the table names of a database connection as rows
Read metadataread 2026-09-27Read metadata about resources from Pentaho Data Catalog
Talend (1)
Database table and column list components (family)read 2026-09-279 components listing table or column names: tDBTableList, tDBColumnList, tMysqlTableList
VisiData (2)
sheets-allread 2026-09-23Open Sheets Sheet: one row per sheet opened this session
sheets-stackread 2026-09-23Open Sheets Stack: one row per active sheet; jump, join, reorder or close them
Background
A database catalog holds metadata defining a database's objects, such as its base tables, views, synonyms, value ranges, indexes, users and user groups.[1] In DuckDB, SHOW DATABASES lists all attached databases, and SHOW SCHEMAS lists the schemas across non-internal databases.[2] In SQLite, every database contains a single schema table, sqlite_schema, with one row for each table, index, view and trigger.[3]
When to use it
In DuckDB, duckdb_databases() lists the databases accessible from within the current DuckDB process, including those attached after startup.[4] List the catalogue first when you arrive at an unfamiliar database or attach a new file, so you know which schemas and tables exist before you describe any one of them. (Meridian's view)
In DuckDB, the duckdb_views() table function returns all views, including those marked internal, while the duckdb_views view returns only views not marked internal.[4] In DuckDB, omitting the parentheses from a duckdb_ table function call may still return a result, from the identically named view.[4] In DuckDB, duckdb_tables() returns base tables, while information_schema.tables also includes views.[4] In DuckDB, a temporary table is not persisted and is visible only within the current connection, and duckdb_tables() marks one in its temporary column.[4]
The method
In DuckDB, the duckdb_ metadata table functions reside in the main schema, and the result of each can be used like an ordinary table or view in a FROM clause.[4] In DuckDB, the sql column of duckdb_tables() gives each table's definition as a CREATE TABLE statement.[4] In DuckDB, SHOW SCHEMAS has a current column marking the default schema, which is set with the USE statement.[2]
In SQLite, the sql column of sqlite_schema stores SQL text that would recreate the object, usually a normalised copy of the original CREATE statement.[3] In SQLite, UNIQUE and PRIMARY KEY constraints cause internal indexes to be created with names of the form sqlite_autoindex_TABLE_N, and their sql column is NULL.[3] In SQLite, the schema table is created with the database and modified as users run data definition language (DDL) statements, and users who modify it themselves risk database corruption.[3]
Sources
- [1]Database catalog - Wikipediasecondary source
- [2]SHOW, SHOW DATABASES, and SHOW SCHEMAS Statements – DuckDBdocumentation
- [3]The Schema Tabledocumentation
- [4]DuckDB_% Metadata Functions – DuckDBdocumentation