Skip to content

Conversation

@PotatoWKY
Copy link
Contributor

Summary

This PR migrates the SQLWorkbench custom API client from the deprecated AWS SDK v2 generator pattern to standalone AWS SDK v3-compatible packages. This migration is required as part of the broader AWS Toolkit repository migration from SDK v2 to v3.

Problem

The AWS Toolkit VSCode repository is deprecating the centralized generateServiceClient.ts script that generates TypeScript clients from service JSON definitions. The SageMaker Unified Studio (SMUS) team currently uses this v2 generator for SQLWorkbench.

Solution

  • Created standalone package @amzn/sql-workbench-client
  • Updated imports to use new standalone package
  • Migrated from SDK v2 .promise() pattern to SDK v3 Command pattern (client.send(command))
  • Updated credential handling to use credential provider function for auto-refresh support
  • Replaced local type definitions with SDK-provided types (DatabaseConnectionConfiguration, ParentResource, Resource, etc.)
  • Removed dependency for SQLWorkbench on the deprecated generateServiceClient.ts script
  • Updated unit tests to mock SDK v3 send method instead of v2 .promise() pattern

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@PotatoWKY PotatoWKY requested a review from a team as a code owner December 10, 2025 01:43
@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@PotatoWKY PotatoWKY force-pushed the sdk-upgrade branch 2 times, most recently from d7f13ec to b4221d9 Compare December 10, 2025 01:51
Copy link
Contributor

@liuzulin liuzulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe what manual tests you performed for this change

},
{
parentId: schemaConnectionConfig.database,
parentId: schemaConnectionConfig.database || '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need this change? let's avoid default to empty unless it's necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is needed.

SDK v3 Type Definitions:

From the new @amzn/sql-workbench-client SDK v3 (3.0.0.tgz):

// ParentResource interface - parentId is required string
export interface ParentResource {
    parentId: string;  // Required, non-nullable
    parentType: string;
}

// DatabaseConnectionConfiguration - database is optional
export interface DatabaseConnectionConfiguration {
    // ...
    database?: string | undefined;  // Optional
}

The Problem:

schemaConnectionConfig.database has type string | undefined (because database is optional in DatabaseConnectionConfiguration)
parentId in ParentResource requires type string (non-nullable)
TypeScript won't allow assigning string | undefined to string
The Fix:

parentId: schemaConnectionConfig.database || ''

@PotatoWKY
Copy link
Contributor Author

Can you describe what manual tests you performed for this change

  • Tested expanding every node under Data Explorer, compared to make sure it has the same behavior as the extension from marketplace
  • Tested expanding half of the nodes under Data Explorer, waited ~25 mins, expand rest of the nodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants