mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 02:02:35 -05:00
Enable scripting for triggers and other objects (#16885)
* WIP 1 * Add parentName to azdata * Add some additional types for scripting * Add parent type name to support view subobjects * bump dependencies and address review comments
This commit is contained in:
@@ -12,6 +12,8 @@ export class ObjectMetadataWrapper implements ObjectMetadata {
|
||||
public urn: string;
|
||||
public name: string;
|
||||
public schema: string;
|
||||
public parentName: string;
|
||||
public parentTypeName: string;
|
||||
|
||||
public get fullName(): string {
|
||||
return `${this.schema}.${this.name}`;
|
||||
@@ -23,6 +25,8 @@ export class ObjectMetadataWrapper implements ObjectMetadata {
|
||||
this.urn = from.urn;
|
||||
this.name = from.name;
|
||||
this.schema = from.schema;
|
||||
this.parentName = from.parentName;
|
||||
this.parentTypeName = from.parentTypeName;
|
||||
}
|
||||
|
||||
public matches(other: ObjectMetadataWrapper): boolean {
|
||||
@@ -32,7 +36,8 @@ export class ObjectMetadataWrapper implements ObjectMetadata {
|
||||
|
||||
return this.metadataType === other.metadataType
|
||||
&& this.schema === other.schema
|
||||
&& this.name === other.name;
|
||||
&& this.name === other.name
|
||||
&& this.parentName === other.parentName;
|
||||
}
|
||||
|
||||
// custom sort : Table > View > Stored Procedures > Function
|
||||
|
||||
@@ -19,35 +19,45 @@ suite('Explorer Widget Tests', () => {
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testView',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.Table,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testTable',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.SProc,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testSProc',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.Function,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testFunction',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.View,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'firstView',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
}
|
||||
].map(m => new ObjectMetadataWrapper(m));
|
||||
|
||||
@@ -84,35 +94,45 @@ suite('Explorer Widget Tests', () => {
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testView',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.Table,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testTable',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.SProc,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testSProc',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.Function,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'testFunction',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
},
|
||||
{
|
||||
metadataType: MetadataType.View,
|
||||
metadataTypeName: undefined,
|
||||
urn: undefined,
|
||||
name: 'firstView',
|
||||
schema: undefined
|
||||
schema: undefined,
|
||||
parentName: undefined,
|
||||
parentTypeName: undefined
|
||||
}
|
||||
].map(o => new ObjectMetadataWrapper(o));
|
||||
const filter = new ExplorerFilter('database', ['name']);
|
||||
|
||||
Reference in New Issue
Block a user