DAB views and stored proc#22257
Conversation
…ission management - Updated `schemaDesignerRpcHandlers.ts` to include new methods for managing entity surface settings and permissions. - Introduced `createEntityWithSurfaceEnabled` to handle enabling/disabling API types for entities. - Added `validatePermissionConfig` to validate permissions for entities, ensuring correct role and action configurations. - Enhanced `applyDabToolChange` to support new changes related to entity surface and permissions. - Updated tests in `dabConfigFileBuilder.test.ts`, `dabSharedInterfaces.test.ts`, `dabTool.test.ts`, and `dabToolManifest.test.ts` to cover new functionalities and ensure correctness. - Adjusted existing tests to reflect changes in entity configurations and expected outputs.
- Added `fieldAccess` to `EntityPermissionConfig` to allow role and action specific field access. - Implemented normalization of permission field access in `normalizePermissionFieldAccess`. - Updated `getEntityPermissions` to include normalized field access for each role. - Introduced `PermissionColumnAccessGrid` component for managing column access per role in the UI. - Enhanced the `DabEntitySettingsDialog` to support displaying and editing column access settings. - Updated tests to verify the new field access functionality and ensure correct emission of permissions.
There was a problem hiding this comment.
Pull request overview
This PR expands the Schema Designer “Data API Builder (DAB)” experience to support additional SQL object types (views + stored procedures), adds a “logical key” workflow for keyless tables/views, and upgrades per-entity exposure/permission modeling (including MCP surface controls), with corresponding UI and Copilot tool schema updates.
Changes:
- Add metadata discovery + source-object modeling for DAB views and stored procedures (including columns/parameters).
- Introduce per-surface exposure controls (REST/GraphQL/MCP), richer permission modeling, and logical-key support for entities without primary keys.
- Update Schema Designer DAB UI (filters, pills/counters, grouping, settings entry points) and extend Copilot DAB tool schema + tests.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/vscode-mssql.xlf | Localization entries added for new DAB UI strings (ignored per guidelines). |
| extensions/mssql/test/unit/metadataService.test.ts | Adds unit coverage for new DAB metadata helper queries/parsing. |
| extensions/mssql/test/unit/dabToolManifest.test.ts | Validates updated Copilot DAB tool schema (new change types and settings). |
| extensions/mssql/test/unit/dabTool.test.ts | Updates Copilot DAB tool behavior tests for new exposure/PK/keyless logic. |
| extensions/mssql/test/unit/dab/dabSharedInterfaces.test.ts | Updates shared DAB defaults/permissions expectations. |
| extensions/mssql/test/unit/dab/dabConfigFileBuilder.test.ts | Updates config builder tests for fields metadata + MCP/permissions output. |
| extensions/mssql/src/webviews/pages/SchemaDesigner/schemaDesignerRpcHandlers.ts | Adds new change handlers (surface, permissions, metadata, MCP) + config normalization tweaks. |
| extensions/mssql/src/webviews/pages/SchemaDesigner/dab/dabToolbar.tsx | Adds per-API counters and richer filtering (object type, exposed-via, auth mode). |
| extensions/mssql/src/webviews/pages/SchemaDesigner/dab/dabPills.tsx | Introduces pill/count helpers for consistent UI styling. |
| extensions/mssql/src/webviews/pages/SchemaDesigner/dab/dabPills.css | Adds pill/count CSS styling. |
| extensions/mssql/src/webviews/pages/SchemaDesigner/dab/dabEntityTable.tsx | Major grid refresh: supports views/procs, grouping, pills, parameters, logical-key indicators. |
| extensions/mssql/src/webviews/pages/SchemaDesigner/dab/dabEntityFilters.ts | Extends filter model to include source types, API exposure, and auth mode. |
| extensions/mssql/src/webviews/pages/SchemaDesigner/dab/dabContext.tsx | Fetches non-table source objects + adds entity-config update plumbing. |
| extensions/mssql/src/webviews/common/locConstants.ts | Adds new localized strings/constants for the updated DAB UI. |
| extensions/mssql/src/sharedInterfaces/metadata.ts | Adds shared metadata interfaces for DAB views/procs. |
| extensions/mssql/src/sharedInterfaces/dab.ts | Expands DAB model: permissions, surfaces, logical-key inference, MCP controls, new requests/changes. |
| extensions/mssql/src/services/metadataService.ts | Implements view/proc discovery and parsing via simple-execute queries. |
| extensions/mssql/src/schemaDesigner/schemaDesignerWebviewController.ts | Adds webview RPC handler to return DAB source objects (views/procs) from metadata. |
| extensions/mssql/src/dab/dabConfigFileBuilder.ts | Emits updated DAB config format: fields metadata, richer permissions, MCP configuration. |
| extensions/mssql/src/copilot/tools/dabTool.ts | Extends telemetry/receipt counters for new DAB change types. |
| extensions/mssql/package.json | Updates Copilot DAB tool schema/description for new operations and settings. |
| extensions/mssql/l10n/bundle.l10n.json | Localization bundle updates for new DAB UI strings (ignored per guidelines). |
| config.entities[resolvedEntity.index] = { | ||
| ...resolvedEntity.entity, | ||
| enabledActions: change.permissions[0]?.actions ?? [], | ||
| advancedSettings: { | ||
| ...resolvedEntity.entity.advancedSettings, | ||
| permissions: change.permissions.map((permission) => ({ | ||
| role: permission.role, | ||
| actions: [...permission.actions], | ||
| })), | ||
| }, | ||
| }; |
|
|
||
| import SqlToolsServiceClient from "../languageservice/serviceclient"; | ||
| import { RequestType } from "vscode-languageclient"; | ||
| import { SimpleExecuteResult } from "vscode-mssql"; |
| const labels: Record<Dab.ApiType, string> = { | ||
| [Dab.ApiType.Rest]: locConstants.schemaDesigner.rest, | ||
| [Dab.ApiType.GraphQL]: "GQL", | ||
| [Dab.ApiType.Mcp]: locConstants.schemaDesigner.mcp, | ||
| }; |
| <Tooltip | ||
| content={`${locConstants.schemaDesigner.alias}: ${alias}`} | ||
| relationship="description"> | ||
| <span className={classes.metadataDetailText}> | ||
| {locConstants.schemaDesigner.alias}: {alias} |
| .dab-pill-rest { | ||
| border-color: rgba(63, 185, 80, 0.35) !important; | ||
| background: rgba(63, 185, 80, 0.12) !important; | ||
| color: #7ee787 !important; | ||
| } |
PR Changes
|
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (66.47%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #22257 +/- ##
==========================================
- Coverage 74.37% 74.24% -0.13%
==========================================
Files 408 408
Lines 128293 129922 +1629
Branches 7768 7940 +172
==========================================
+ Hits 95413 96466 +1053
- Misses 32880 33456 +576
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Description
Stored Procedure:
Views:
Tables can now grant different CRUD operations to anonymous and authenticated roles.

Column-level permissions can be expanded and configured when needed. They are collapsed by default.

Each entity can be included or excluded per API type, and API exposure plus permissions are now visible directly in the main grid.
Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines