API functionality for DDL statements #20164
Unanswered
gadeynebram
asked this question in
Q&A
Replies: 1 comment
-
I opened a Feature Request for a related question; I tried to create a simple extension using the API (see the link). Looking at the example code, I found const script = await connectionSharingService.scriptObject(
databaseConnectionUri,
0,
{
name: "databases",
schema: "sys",
type: "Table",
}
); Where /**
* Script an object from the database using the connection URI.
* @param connectionUri The URI of the connection to use for scripting.
* @param operation The operation to perform (e.g., ScriptCreate, ScriptDrop, etc.).
* @param scriptingObject The object to script, containing its type, schema, name, and parent information.
* @return A promise that resolves with the scripted SQL string, or undefined if the operation failed.
*/
scriptObject(
connectionUri: string,
operation: ScriptOperation,
scriptingObject: IScriptingObject
): Promise<string | undefined>; And export enum ScriptOperation {
Select = 0,
Create = 1,
Insert = 2,
Update = 3,
Delete = 4,
Execute = 5,
Alter = 6,
} I hope this help. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I found this issue #19519 regarding the API.
Previously I was working with Azure Data Studio which is end of support. Specifically I was working with the data virtualisation wizard offered there. Since this will not be provided through the mssql extension, I was looking into creating a new extension for VSCode. One that provides a reduced set of the functionality that I used. I was trying to use the exported API for this.
I found the executeSimpleQuery method but this does not seem to allow for DDL statements to be executed. Are there any additional methods available for this?
vscode-mssql/typings/vscode-mssql.d.ts
Lines 2547 to 2556 in accc24d
Beta Was this translation helpful? Give feedback.
All reactions