Skip to content

@sqlrooms/duckdb / useDataTable

Function: useDataTable()

useDataTable(tableName): DataTable | undefined

Resolves a table reference against the DuckDB table schema cache.

String inputs are delegated to db.findTable, which parses qualified SQL identifiers such as main.events and "memory"."main"."events.2026". Unqualified names resolve in the current schema/database from the last schema refresh.

Parameters

ParameterTypeDescription
tableNamestring | QualifiedTableName | undefinedA bare, qualified, or structured table reference.

Returns

DataTable | undefined

The matching data table, including its loaded columns, or undefined.