feat(transactions): add manual transactions to more execution paths
This commit is contained in:
1 parent
88ba58a79c
commit
a924285136
38 files changed
+2471
-146
No files matched your search
@@ -295,7 +295,7 @@ const executeButtonClass = computed(() => {
|
||||
const canMultiExecute = computed(() => {
|
||||
if (!supportsQueryExecution(props.activeConnection?.db_type)) return false;
|
||||
if (props.activeTab.isExecuting || props.activeTab.isExplaining || props.activeTab.isCancelling) return false;
|
||||
if (props.autoCommit === false || isTransactionActive.value) return false;
|
||||
if (isTransactionActive.value) return false;
|
||||
return !!props.executableSql.trim();
|
||||
});
|
||||
|
||||
|
||||
+8
@@ -131,6 +131,14 @@ describe("EditorToolbar commit/rollback visibility", () => {
|
||||
const commitSelector = `button[aria-label="toolbar.commit"]`;
|
||||
const rollbackSelector = `button[aria-label="toolbar.rollback"]`;
|
||||
|
||||
it.each([undefined, "active-session"])("only opens independent multi-db transactions when the source has no active session (%s)", async (txnSessionId) => {
|
||||
const host = await mountToolbar({ dbType: "oceanbase-oracle", stickyProvenReadOnlyState: true, txnSessionId });
|
||||
const multiDb = host.querySelector<HTMLButtonElement>('button[aria-label="toolbar.multiDbExecute"]');
|
||||
expect(multiDb).not.toBeNull();
|
||||
expect(multiDb!.disabled).toBe(!!txnSessionId);
|
||||
host.remove();
|
||||
});
|
||||
|
||||
it("hides Commit/Rollback for a clean MySQL sticky manual session", async () => {
|
||||
const host = await mountToolbar({ dbType: "mysql", stickyProvenReadOnlyState: true, txnPossiblyDirty: false, txnSessionId: "txn-1" });
|
||||
|
||||
|
||||
Reference in new issue
Block a user