Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
c884876
feat(windows): production cue, database switchers, find and replace, …
datlechin Nov 14, 2026
094d86a
Merge remote-tracking branch 'origin/main' into feat/windows-workspac…
datlechin Nov 14, 2026
3fabde6
fix(windows): keep a sql file tab's baseline and unsaved text across …
datlechin Nov 14, 2026
9fc149e
fix(windows): reconnect a connection's other databases after an edit,…
datlechin Nov 14, 2026
24fac24
fix(windows): recover unsaved file text only after an end without a c…
datlechin Nov 14, 2026
5b877ac
fix(windows): give the settings page's clear history button its own r…
datlechin Nov 14, 2026
6ec9028
fix(windows): keep a sql file's access list when it is saved
datlechin Nov 14, 2026
3cb993a
fix(windows): draw the editor's find bar in the app's theme, not the …
datlechin Nov 14, 2026
8c68e71
fix(windows): read sql files off the UI thread and let a close wait f…
datlechin Nov 14, 2026
c6897df
fix(windows): run every sql file operation as tab work and offer Stop…
datlechin Nov 14, 2026
d58cac9
fix(windows): sort held rows after a database switch, ask before savi…
datlechin Nov 14, 2026
5919f69
fix(windows): keep a run's statement when it moved the database, and …
datlechin Nov 14, 2026
52ea5db
fix(windows): keep a tab with text typed during its close save, check…
datlechin Nov 14, 2026
5dfdd2b
fix(windows): write the session when the recent files change
datlechin Nov 14, 2026
f94b24f
test(windows): click the database menu's radio items, which offer no …
datlechin Nov 14, 2026
54008a1
Merge remote-tracking branch 'origin/main' into feat/windows-workspac…
datlechin Nov 14, 2026
3a85358
Merge remote-tracking branch 'origin/main' into feat/windows-workspac…
datlechin Nov 14, 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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions core/crates/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ windows-sys.workspace = true

[dev-dependencies]
tablepro-account = { workspace = true, features = ["fakes"] }
tablepro-session = { workspace = true, features = ["fakes", "in-process-ssh"] }
tablepro-test-support.workspace = true
csbindgen.workspace = true
russh.workspace = true
tempfile.workspace = true
Expand Down
24 changes: 21 additions & 3 deletions core/crates/ffi/src/core_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use tablepro_account::{AccountSettings, RefreshTokenVault};
use tablepro_core::credentials::{CredentialInteraction, CredentialPrompter, SecretItems, SecretKind, SecretVault};
use tablepro_core::{
ConnectEnvironment, Credentials, DatabaseDriver, DriverError, DriverRegistry, FileEndpoint, LivenessPolicy,
SafeModeLevel, WorkspaceSettings,
SafeModeLevel, UnsupportedFeature, WorkspaceSettings,
};
use tablepro_session::runtime::Tasks;
use tablepro_session::{
Expand Down Expand Up @@ -177,9 +177,11 @@ impl Core {
}

// Typed secrets come first, then Credential Manager; `keep` is stored once it logs in; no prompter, no SSH asks.
// `database`, in place of the saved one, opens the connection in another of the server's databases.
pub async fn connect_saved(
&self,
id: String,
database: Option<String>,
secrets: ConnectionSecrets,
keep: ConnectionSecrets,
prompter: Option<Box<dyn HostPrompter>>,
Expand Down Expand Up @@ -215,8 +217,17 @@ impl Core {
CredentialDemand::default(),
)
.await?;
let request = match database.as_deref().filter(|name| !name.is_empty()) {
Some(database) => refreshed
.request
.in_database(database)
.ok_or(DriverError::Unsupported {
feature: UnsupportedFeature::NetworkConnection,
})?,
None => refreshed.request,
};
let pending = connector
.establish(refreshed.request, interaction(prompter.as_ref()), cancel.clone())
.establish(request, interaction(prompter.as_ref()), cancel.clone())
.await?;
if cancel.is_cancelled() {
let report = pending.discard().await;
Expand Down Expand Up @@ -657,7 +668,14 @@ mod tests {
};

let connect = core
.connect_saved(stored.id.to_string(), typed(), ConnectionSecrets::default(), None, None)
.connect_saved(
stored.id.to_string(),
None,
typed(),
ConnectionSecrets::default(),
None,
None,
)
.await
.unwrap_err();
let test = core
Expand Down
8 changes: 7 additions & 1 deletion core/crates/ffi/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ impl QueryEditor {
self.editor.state() == EditorSessionState::Lost
}

// Where a definition names no database of its own, its text has to run in the one it was read from.
// The database an unqualified name resolves to now, as the server last said, a typed USE included. None where
// the engine does not follow it.
pub fn database(&self) -> Option<String> {
self.editor.database().filter(|name| !name.is_empty())
}

// Moves the editor's connection, keeping its transaction. An engine that binds the database at connect refuses.
pub async fn use_database(&self, database: String, cancel: Option<Arc<CancelToken>>) -> Result<(), CoreError> {
let editor = self.editor.clone();
let cancel = token(cancel);
Expand Down
14 changes: 14 additions & 0 deletions core/crates/ffi/src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@ impl QueryHistoryStore {
.await
}

// Drops unpinned entries older than `retention_days` (0 keeps every age), then the oldest past `max_entries`
// (0 keeps the store's own cap). Returns how many went.
pub async fn prune(&self, retention_days: u32, max_entries: u32) -> Result<u64, CoreError> {
let history = self.history.clone();
on_runtime(&self.tasks, async move {
let report = match max_entries {
0 => history.prune(retention_days).await?,
kept => history.prune_keeping(retention_days, kept).await?,
};
Ok(report.total())
})
.await
}

pub async fn clear(&self) -> Result<(), CoreError> {
let history = self.history.clone();
on_runtime(&self.tasks, async move {
Expand Down
Loading
Loading