diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 718c69c2d1..866bfd3212 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -1098,7 +1098,9 @@ declare module 'azdata' { Length = 'length', Name = 'name', Type = 'type', - IsPrimaryKey = 'isPrimaryKey' + IsPrimaryKey = 'isPrimaryKey', + Precision = 'precision', + Scale = 'scale' } /** @@ -1117,6 +1119,10 @@ declare module 'azdata' { * Additional tabs. */ additionalTabs?: DesignerTab[]; + /** + * The properties to be displayed in the columns table. Default values are: Name, Type, Length, Precision, Scale, IsPrimaryKey, AllowNulls, DefaultValue. + */ + columnsTableProperties?: string[]; } /** @@ -1148,6 +1154,11 @@ declare module 'azdata' { * The property name */ propertyName: string; + + /** + * The description of the property + */ + description?: string; /** * The component type */ diff --git a/src/sql/base/browser/ui/designer/interfaces.ts b/src/sql/base/browser/ui/designer/interfaces.ts index e8a9ee3bd5..6ed6373516 100644 --- a/src/sql/base/browser/ui/designer/interfaces.ts +++ b/src/sql/base/browser/ui/designer/interfaces.ts @@ -110,6 +110,7 @@ export interface DesignerViewModel { export interface DesignerDataPropertyInfo { propertyName: string; + description?: string; componentType: DesignerComponentTypeName; group?: string; componentProperties?: InputBoxProperties | CheckBoxProperties | DropDownProperties | DesignerTableProperties; diff --git a/src/sql/workbench/api/common/sqlExtHostTypes.ts b/src/sql/workbench/api/common/sqlExtHostTypes.ts index d60b544512..928f0d368f 100644 --- a/src/sql/workbench/api/common/sqlExtHostTypes.ts +++ b/src/sql/workbench/api/common/sqlExtHostTypes.ts @@ -922,7 +922,9 @@ export namespace designers { AllowNulls = 'allowNulls', DefaultValue = 'defaultValue', Length = 'length', - IsPrimaryKey = 'isPrimaryKey' + IsPrimaryKey = 'isPrimaryKey', + Precision = 'precision', + Scale = 'scale' } export enum DesignerEditType { diff --git a/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts b/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts index ec39e82090..7b4f87dfa7 100644 --- a/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts +++ b/src/sql/workbench/services/tableDesigner/browser/tableDesignerComponentInput.ts @@ -190,7 +190,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput { propertyName: designers.TableColumnProperty.Length, componentProperties: { title: localize('tableDesigner.columnLengthTitle', "Length"), - width: 75 + width: 60 } }, { componentType: 'input', @@ -211,6 +211,20 @@ export class TableDesignerComponentInput implements DesignerComponentInput { componentProperties: { title: localize('tableDesigner.columnIsPrimaryKeyTitle', "Primary Key"), } + }, { + componentType: 'input', + propertyName: designers.TableColumnProperty.Precision, + componentProperties: { + title: localize('tableDesigner.columnPrecisionTitle', "Precision"), + width: 60 + } + }, { + componentType: 'input', + propertyName: designers.TableColumnProperty.Scale, + componentProperties: { + title: localize('tableDesigner.columnScaleTitle', "Scale"), + width: 60 + } } ]; @@ -218,6 +232,17 @@ export class TableDesignerComponentInput implements DesignerComponentInput { columnProperties.push(...designerInfo.view.additionalTableColumnProperties); } + const columnsTableProperties = designerInfo.view.columnsTableProperties || [ + designers.TableColumnProperty.Name, + designers.TableColumnProperty.Type, + designers.TableColumnProperty.Length, + designers.TableColumnProperty.Precision, + designers.TableColumnProperty.Scale, + designers.TableColumnProperty.IsPrimaryKey, + designers.TableColumnProperty.AllowNulls, + designers.TableColumnProperty.DefaultValue, + ]; + const columnsTab = { title: localize('tableDesigner.columnsTabTitle', "Columns"), components: [ @@ -226,14 +251,7 @@ export class TableDesignerComponentInput implements DesignerComponentInput { propertyName: designers.TableProperty.Columns, componentProperties: { ariaLabel: localize('tableDesigner.columnsTabTitle', "Columns"), - columns: [ - designers.TableColumnProperty.Name, - designers.TableColumnProperty.Type, - designers.TableColumnProperty.Length, - designers.TableColumnProperty.DefaultValue, - designers.TableColumnProperty.AllowNulls, - designers.TableColumnProperty.IsPrimaryKey - ], + columns: columnsTableProperties, itemProperties: columnProperties, objectTypeDisplayName: localize('tableDesigner.columnTypeName', "Column") }