Function: fetchStatementData()
fetchStatementData(
client,statementId,options?):Promise<{columns:string[];rowCount:number;rows:Record<string,unknown>[]; }>
Fetch a single statement’s rows via the Statement Execution API and reshape into the shared GenieDatasetData shape (column array + row records).
Optional limit slices the returned rows client-side so the
agent can scan a small sample without paging the full result
set into context. rowCount always reflects the upstream total
so callers know when the slice truncated.
Exported because every consumer in the plugin (the
get_statement tool, the prepare_chart dataset resolver, and
the /embed/data/:id route) needs the exact same
fetch + coercion pipeline so LLM-side get_statement output
and UI-side [data:<id>] rendering stay shape-identical for
the same statement_id.
Parameters
Section titled “Parameters”client
Section titled “client”WorkspaceClient$1
statementId
Section titled “statementId”string
options?
Section titled “options?”limit?
Section titled “limit?”number
signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ columns: string[]; rowCount: number; rows: Record<string, unknown>[]; }>