feat: auto-detect OceanBase Oracle mode and use Oracle-style schema queries (#155)
Introduce MysqlMode enum to distinguish Normal/Bare/OceanBaseOracle MySQL connections. On connect, if driver_profile contains "oceanbase", detect tenant mode via SHOW VARIABLES LIKE 'ob_compatibility_mode'. When Oracle mode is detected, schema queries use ALL_TABLES/ALL_TAB_COLUMNS/etc.
This commit is contained in:
1 parent
0e2fbc5a40
commit
dfd4d2d99d
7 files changed
+286
-20
No files matched your search
@@ -473,9 +473,9 @@ pub async fn execute_on_pool(state: &AppState, pool_key: &str, sql: &str) -> Res
|
||||
let pool = connections.get(pool_key).ok_or("Connection not found")?;
|
||||
|
||||
match pool {
|
||||
PoolKind::Mysql(p, bare) => {
|
||||
PoolKind::Mysql(p, mode) => {
|
||||
let p = p.clone();
|
||||
let bare = *bare;
|
||||
let bare = *mode == crate::connection::MysqlMode::Bare;
|
||||
drop(connections);
|
||||
db::mysql::execute_query(&p, sql, bare).await
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user