fix(sqlserver): load table structure metadata

This commit is contained in:
t8y2
2026-05-17 20:10:21 +08:00
parent a16fed35d4
commit 489d7ae919
3 changed files with 85 additions and 32 deletions
@@ -166,11 +166,22 @@ async function loadStructure() {
errorMessage.value = "";
try {
await store.ensureConnected(props.prefillConnectionId);
const [nextColumns, nextIndexes, nextForeignKeys, nextTriggers] = await Promise.all([
api.getColumns(props.prefillConnectionId, props.prefillDatabase, targetSchema.value, props.prefillTable),
api.listIndexes(props.prefillConnectionId, props.prefillDatabase, targetSchema.value, props.prefillTable),
api.listForeignKeys(props.prefillConnectionId, props.prefillDatabase, targetSchema.value, props.prefillTable),
api.listTriggers(props.prefillConnectionId, props.prefillDatabase, targetSchema.value, props.prefillTable),
const nextColumns = await api.getColumns(
props.prefillConnectionId,
props.prefillDatabase,
targetSchema.value,
props.prefillTable,
);
const [nextIndexes, nextForeignKeys, nextTriggers] = await Promise.all([
api
.listIndexes(props.prefillConnectionId, props.prefillDatabase, targetSchema.value, props.prefillTable)
.catch(() => []),
api
.listForeignKeys(props.prefillConnectionId, props.prefillDatabase, targetSchema.value, props.prefillTable)
.catch(() => []),
api
.listTriggers(props.prefillConnectionId, props.prefillDatabase, targetSchema.value, props.prefillTable)
.catch(() => []),
]);
columns.value = createColumnDrafts(nextColumns);
indexes.value = createIndexDrafts(nextIndexes);