Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c48a901
feat: enhance Oracle connection form with 3 connection methods and ro…
Blankll Jun 19, 2026
65a3890
fix: show full TNS alias names as-is, no level suffix stripping
Blankll Jun 19, 2026
8f5930a
fix: Oracle connection form issues from review
Blankll Jun 20, 2026
4698b63
feat: Oracle Cloud Wallet (ATP/ADW) connection support
Blankll Jun 20, 2026
c0e7717
fix(jdbc-bridge): cross-database audit fixes
Blankll Jun 20, 2026
c337f5d
feat(connection): RwLock, timeouts, health guardian, ConnectionHandle…
Blankll Jun 20, 2026
ed34843
fix(guardian): spawn via tauri::async_runtime instead of tokio::spawn
Blankll Jun 20, 2026
e3b578f
fix(ui): add drag spacer to header for window dragging
Blankll Jun 20, 2026
353dc41
fix(ui): set decorations:false on macOS to enable header drag
Blankll Jun 20, 2026
eba754d
fix(ui): remove data-tauri-drag-region, let native titlebar handle drag
Blankll Jun 20, 2026
8a21abe
fix(ui): add explicit -webkit-app-region:drag CSS rule
Blankll Jun 20, 2026
e0a6cf3
fix(ui): body-level -webkit-app-region:drag with no-drag on interacti…
Blankll Jun 20, 2026
898b8a2
chore: config
Blankll Jun 20, 2026
6607874
fix(connection): wire up dead code — GUARDIAN, ConnectionHandle trait…
Blankll Jun 20, 2026
48ecabc
fix(connection): P0 connect timeout + P1 evict_idle logic bug
Blankll Jun 20, 2026
5634bf1
fix(connection): wire LRU cache into query flow + explain guardian check
Blankll Jun 20, 2026
1067f41
fix(mysql): list_schemas regression — return only requested database
Blankll Jun 20, 2026
339e442
fix(browse): complete trait migration — remaining match arms in brows…
Blankll Jun 20, 2026
47da5aa
fix(jdbc): expand download_jdbc_driver_direct to all 22 JDBC databases
Blankll Jun 20, 2026
5ba1d10
chore: remove unused imports after trait migration
Blankll Jun 20, 2026
68ca7b7
fix(guardian): access AppState via APP_HANDLE instead of Arc<AppState>
Blankll Jun 20, 2026
c1984db
merge: resolve conflicts with master (window controls + guardian)
Blankll Jun 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src-tauri/src/commands/connection.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::connection::handle::ConnectionHandle;
use crate::database::{ConnectionStatus, DatabaseAdapter};
use crate::state::{ActiveConnection, AppState};
use crate::database::ConnectionStatus;
use crate::state::AppState;
use tauri::State;

#[tauri::command]
Expand Down
30 changes: 21 additions & 9 deletions src-tauri/src/connection/guardian.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::database::adapter::DatabaseAdapter;
use crate::state::{ActiveConnection, AppState};
use crate::APP_HANDLE;
use serde::Serialize;
use tauri::Emitter;
use tauri::{Emitter, Manager};
use std::collections::HashMap;
use std::sync::Arc;
use std::time::{Duration, Instant};
Expand Down Expand Up @@ -91,15 +91,13 @@ impl Default for ConnectionHealth {

pub struct ConnectionGuardian {
health: Arc<RwLock<HashMap<String, ConnectionHealth>>>,
app_state: Arc<AppState>,
idle_eviction_secs: u64,
}

impl ConnectionGuardian {
pub fn new(app_state: Arc<AppState>) -> Self {
pub fn new() -> Self {
Self {
health: Arc::new(RwLock::new(HashMap::new())),
app_state,
idle_eviction_secs: DEFAULT_IDLE_EVICTION_SECS,
}
}
Expand Down Expand Up @@ -302,24 +300,30 @@ impl ConnectionGuardian {
};

for conn_id in to_evict {
let state = APP_HANDLE
.get()
.expect("APP_HANDLE not initialized")
.state::<AppState>();
let connection_exists = {
let conns = self.app_state.connections.read().await;
let conns = state.connections.read().await;
conns.contains_key(&conn_id)
};
if !connection_exists {
drop(state);
self.health.write().await.remove(&conn_id);
continue;
}
// Gracefully disconnect idle connection
log::info!("Connection '{conn_id}' idle for {}s, evicting", self.idle_eviction_secs);
let conns = self.app_state.connections.write().await;
let conns = state.connections.write().await;
if let Some(connection) = conns.get(&conn_id) {
self.disconnect_connection(connection).await;
}
drop(conns);
let mut conns = self.app_state.connections.write().await;
let mut conns = state.connections.write().await;
conns.remove(&conn_id);
drop(conns);
drop(state);
self.health.write().await.remove(&conn_id);
self.emit_state_change(&conn_id, HealthState::Dead, Some("Idle eviction".into()));
}
Expand Down Expand Up @@ -354,7 +358,11 @@ impl ConnectionGuardian {

// Try to reconnect by calling test_connection on the active connection
let success = {
let conns = self.app_state.connections.read().await;
let state = APP_HANDLE
.get()
.expect("APP_HANDLE not initialized")
.state::<AppState>();
let conns = state.connections.read().await;
let conn = conns.get(connection_id);
match conn {
Some(c) => self.ping_connection(c).await,
Expand Down Expand Up @@ -382,7 +390,11 @@ impl ConnectionGuardian {
}

async fn ping(&self, connection_id: &str) {
let conns = self.app_state.connections.read().await;
let state = APP_HANDLE
.get()
.expect("APP_HANDLE not initialized")
.state::<AppState>();
let conns = state.connections.read().await;
let conn = match conns.get(connection_id) {
Some(c) => c,
None => return,
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn run() {
let _ = APP_HANDLE.set(handle.clone());

// Start connection guardian for health monitoring + auto-reconnect
let guardian = Arc::new(ConnectionGuardian::new(app_state.clone()));
let guardian = Arc::new(ConnectionGuardian::new());
let _ = GUARDIAN.set(guardian.clone());
tauri::async_runtime::spawn(async move { guardian.run().await });

Expand Down
Loading