Skip to content

Commit 7854d52

Browse files
committed
fix: segment resolution
1 parent d726d13 commit 7854d52

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

webapp/packages/plugin-sql-editor/src/SqlEditor/useSqlEditor.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ export function useSqlEditor(state: ISqlEditorTabState): ISQLEditorData {
187187
}
188188

189189
try {
190-
await this.executeQueryAction(await this.executeQueryAction(this.model.cursorSegment, () => this.model.getResolvedSegment()), query =>
191-
this.sqlQueryService.executeEditorQuery(this.state, query.query, false),
192-
);
190+
const segment = await this.model.getResolvedSegment();
191+
await this.executeQueryAction(segment, query => this.sqlQueryService.executeEditorQuery(this.state, query.query, false));
193192
} catch {}
194193
},
195194

196195
async loadDatabaseDataModels(): Promise<void> {
196+
await this.model.getResolvedSegment();
197197
await this.executeQueryAction(
198198
this.model.cursorSegment,
199199
() => {
@@ -228,9 +228,8 @@ export function useSqlEditor(state: ISqlEditorTabState): ISQLEditorData {
228228
}
229229

230230
try {
231-
await this.executeQueryAction(await this.executeQueryAction(this.model.cursorSegment, () => this.model.getResolvedSegment()), query =>
232-
this.sqlExecutionPlanService.executeExecutionPlan(this.state, query.query),
233-
);
231+
const segment = await this.model.getResolvedSegment();
232+
await this.executeQueryAction(segment, query => this.sqlExecutionPlanService.executeExecutionPlan(this.state, query.query));
234233
} catch {}
235234
},
236235

0 commit comments

Comments
 (0)