fix(oracle): lazy load table triggers
This commit is contained in:
1 parent
132ac8a2ec
commit
5600872565
4 files changed
+116
-25
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import type { TableInfoTab } from "@/types/database";
|
||||
|
||||
export interface TableStructureRefreshScope {
|
||||
columns: boolean;
|
||||
indexes: boolean;
|
||||
foreignKeys: boolean;
|
||||
triggers: boolean;
|
||||
tableComment: boolean;
|
||||
}
|
||||
|
||||
export function visibleTableStructureRefreshScope(activeTab: TableInfoTab): TableStructureRefreshScope {
|
||||
return {
|
||||
columns: true,
|
||||
indexes: true,
|
||||
foreignKeys: true,
|
||||
// Trigger definitions can contain large source bodies, so defer them until
|
||||
// the trigger editor is actually visible.
|
||||
triggers: activeTab === "triggers",
|
||||
tableComment: true,
|
||||
};
|
||||
}
|
||||
|
||||
export const TRIGGERS_ONLY_REFRESH_SCOPE: TableStructureRefreshScope = {
|
||||
columns: false,
|
||||
indexes: false,
|
||||
foreignKeys: false,
|
||||
triggers: true,
|
||||
tableComment: false,
|
||||
};
|
||||
|
||||
export function shouldLoadTableStructureTriggers(options: { activeTab: TableInfoTab; isCreateMode: boolean; supported: boolean; loaded: boolean; loading: boolean; structureLoading: boolean }): boolean {
|
||||
return options.activeTab === "triggers" && !options.isCreateMode && options.supported && !options.loaded && !options.loading && !options.structureLoading;
|
||||
}
|
||||
Reference in new issue
Block a user