Skip to content

Data Connections: Add schema-summarization helper #14926

Description

@timtmok

Context

Part of the implementation plan in #14658 for schema-aware Assistant responses. IDataConnectionHandle (src/vs/workbench/services/positronDataConnections/common/interfaces/dataConnectionDriver.ts) only exposes lazy, per-node tree walking (getChildren()/nodeGetChildren()) built for UI rendering - there's no API to produce a bounded schema summary for a whole connection. This is issue 1 of 2; issue 2 (the getSchema command) depends on this helper.

AC

  • New summarizeDataConnectionSchema(handle: IDataConnectionHandle, options?: { maxDepth?, maxNodesPerLevel?, maxTotalNodes? }): Promise<IDataConnectionSchemaSummary> in new file src/vs/workbench/services/positronDataConnections/common/dataConnectionSchemaSummary.ts, recursively walking getChildren()/nodeGetChildren().
  • Bounded output via defaults (maxDepth=4, maxNodesPerLevel=50, maxTotalNodes=500); on a cap, annotate the parent node with truncatedChildCount instead of dropping data silently.
  • Flatten container-only DataConnectionNodeKind values (src/positron-dts/positron.d.ts) into their parent so they don't add nodes with no schema information.
  • Output is a plain JSON-serializable tree: IDataConnectionSchemaSummary { instanceId; nodes: IDataConnectionSchemaNode[]; truncated: boolean }, IDataConnectionSchemaNode { name; kind; dataType?; isPrimaryKey?; children?; truncatedChildCount? }.

Testing

Metadata

Metadata

Assignees

Labels

area: connectionsIssues related to Connections category.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions