feat(sqlserver): enable table structure editing for existing columns and comments

- Enable renameColumn, alterExistingColumn, alterType, alterNullability,
  alterDefault, comment, and indexComment capabilities for SQL Server
- Implement build_sqlserver_existing_column_sql() with sp_rename for column
  rename, ALTER TABLE ALTER COLUMN for type/nullability changes, and dynamic
  SQL for default constraint management
- Add sp_addextendedproperty/sp_dropextendedproperty DDL generation for table,
  column, and index comments
- Fetch table and column comments from sys.extended_properties via OUTER APPLY
  in list_tables, list_objects, and get_columns SQL queries
- Fix table comment placeholder text (was showing column comment placeholder)
This commit is contained in:
t8y2
2026-05-27 22:28:31 +08:00
parent 50a7fd8968
commit 634e8bf5ac
7 changed files with 291 additions and 20 deletions
@@ -464,7 +464,7 @@ watch(
<label class="shrink-0 text-[11px] font-medium text-muted-foreground">{{ t("structureEditor.comment") }}</label>
<Input
v-model="tableComment"
:placeholder="t('structureEditor.commentPlaceholder')"
:placeholder="t('structureEditor.tableCommentPlaceholder')"
class="h-6 max-w-[320px] text-[11px]"
/>
</div>
+1
View File
@@ -973,6 +973,7 @@ export default {
comment: "Comment",
editComment: "Edit comment",
commentPlaceholder: "Enter column comment...",
tableCommentPlaceholder: "Enter table comment...",
actions: "Actions",
indexName: "Index",
indexColumns: "Columns",
+1
View File
@@ -867,6 +867,7 @@ export default {
comment: "Comentario",
editComment: "Editar comentario",
commentPlaceholder: "Ingresar comentario de columna...",
tableCommentPlaceholder: "Ingresar comentario de tabla...",
actions: "Acciones",
indexName: "Índice",
indexColumns: "Columnas",
+1
View File
@@ -951,6 +951,7 @@ export default {
comment: "注释",
editComment: "编辑注释",
commentPlaceholder: "输入字段注释...",
tableCommentPlaceholder: "输入表注释...",
actions: "操作",
indexName: "索引名",
indexColumns: "字段列表",
@@ -139,12 +139,19 @@ const sqlserverCapabilities = capabilities({
createTable: true,
addColumn: true,
dropColumn: true,
renameColumn: true,
alterExistingColumn: true,
alterType: true,
alterNullability: true,
alterDefault: true,
comment: true,
createIndex: true,
dropIndex: true,
rebuildIndex: true,
indexType: true,
indexInclude: true,
indexFilter: true,
indexComment: true,
});
const oracleCapabilities = capabilities({