Port ObjectManagementService RPC methods from Azure Data Studio #20626
+849
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Ports the ObjectManagementService RPC interface from Azure Data Studio to enable database object management operations (backup, restore, attach/detach, credentials, etc.) in VS Code MSSQL extension.
Implementation
Type Definitions (
typings/vscode-mssql.d.ts)IObjectManagementServiceinterface with 17 methods for object/database operationsObjectManagementnamespace containingNodeTypeenum,SqlObject,ObjectViewInfo,SearchResultItemBackupInfo,DatabaseFileData,BackupResponse,CredentialInfoRPC Contracts (
src/models/contracts/objectManagement/objectManagementContracts.ts)RequestTypedefinitions matching Azure Data Studio's RPC method namesService Implementation (
src/services/objectManagementService.ts)IObjectManagementServiceusingSqlToolsServiceClientDacFxServicepattern with async/await RPC callsMethods Implemented
Object operations:
initializeView,save,script,disposeView,rename,drop,searchDatabase operations:
detachDatabase,attachDatabases,backupDatabase,dropDatabaseHelpers:
getDataFolder,getBackupFolder,getAssociatedFiles,purgeQueryStoreData,createCredential,getCredentialNamesNote: Service is not yet wired into
mainController.tsorextension.tsAPI—ready for integration when needed.Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines
Original prompt
Agent Instructions: Porting RPC Methods from Azure Data Studio to VS Code MSSQL
Overview
This guide enables an AI agent to port RPC-based functionality from Azure Data Studio (ADS) to the VS Code MSSQL extension following established patterns.
Prerequisites
Input Required
The agent needs:
src/sql/workbench/services/profiler/)Step-by-Step Porting Process
Phase 1: Discovery and Analysis in Azure Data Studio Repo
Step 1.1: Locate the Service Interface
Search Pattern:
I{FunctionalityName}ServiceinterfaceTypical Location:
src/sql/workbench/services/{functionality}/common/{functionality}Service.tsAgent Actions:
IProfilerService)Example Interface to Extract:
Step 1.2: Locate Request/Response Contracts
Search Pattern: Request and Response type definitions
Typical Location:
src/sql/workbench/services/{functionality}/common/{functionality}Contracts.tsor similarAgent Actions:
*Requestand*Responsetypes*Paramstypes*NotificationParams)Example Contracts to Extract:
Step 1.3: Locate RPC Request Definitions
Search Pattern:
RequestTypeandNotificationTypedefinitionsTypical Location: Same file as contracts or in a separate
*Contracts.tsfileAgent Actions:
RequestType<TParams, TResult>definitionsNotificationType<TParams>definitionsExample RPC Definitions to Extract:
Step 1.4: Locate Supporting Types
Agent Actions:
ProfilerSessionTemplate,ProfilerEvent)ProfilingSessionType)Phase 2: Generate VS Code MSSQL Extension Files
Step 2.1: Generate
vscode-mssql.d.tsTypesFile Location:
mssql/typings/vscode-mssql.d.tsAgent Instructions:
vscode-mssql.d.tsfiledeclare module "vscode-mssql"sectionIDacFxService)Template for Service Interface:
Template for Types:
Important Notes:
import * as azdata)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.