fix(oceanbase): support manual transaction control in oracle mode

This commit is contained in:
zipg authored and GitHub committed 2026-09-15 15:37:36 +08:00
1 parent 39042f7917
commit 2b1c5fa71e
15 files changed
+391 -52

No files matched your search

@@ -257,7 +257,12 @@ export function usesPostgresLikeStructureCopy(dbType?: DatabaseType): boolean {
return !!dbType && PG_LIKE_STRUCTURE_TYPES.has(dbType);
}
const TRANSACTION_SUPPORTED_TYPES: readonly string[] = ["postgres", "mysql", "oracle", "jdbc"];
const TRANSACTION_SUPPORTED_TYPES: readonly string[] = ["postgres", "mysql", "oracle", "jdbc", "oceanbase-oracle"];
/** Oracle-family databases that use the sticky manual-transaction UX. OceanBase
* Oracle mode runs the same transaction model as Oracle, so it shares the
* commit/rollback dirty-state behavior rather than the generic transaction path. */
const ORACLE_STICKY_TRANSACTION_TYPES: ReadonlySet<string> = new Set(["oracle", "oceanbase-oracle"]);
/**
* Returns true if the given database type supports explicit transaction control
@@ -311,6 +316,14 @@ export function rejectsAliasReferenceInHaving(dbType?: string): boolean {
return !!dbType && HAVING_ALIAS_REJECTED_DATABASE_TYPES.has(dbType);
}
/**
* Returns true if the database type uses Oracle's sticky manual-transaction state
* (commit/rollback hidden until an unproven statement dirties the session).
*/
export function usesOracleStickyTransactionState(dbType?: string): boolean {
return !!dbType && ORACLE_STICKY_TRANSACTION_TYPES.has(dbType);
}
/**
* Default auto-commit mode when opening a query tab for the given database type.
* Query tabs default to auto-commit; users can explicitly switch to manual transactions.