feat(usable): integrate current dbtool implementation snapshot
Some checks failed
release-smoke / macos-13 / x86_64-apple-darwin (push) Has been cancelled
release-smoke / ubuntu-latest / x86_64-unknown-linux-gnu (push) Has been cancelled
release-smoke / windows-latest / x86_64-pc-windows-msvc (push) Has been cancelled

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Paperclip CTO
2026-04-02 08:26:18 +00:00
parent a28dab4cd9
commit d5f69462b0
73 changed files with 5895 additions and 322 deletions

View File

@@ -5,7 +5,7 @@ use std::process::ExitCode;
use db_app::{
self, AppError, ColumnItem, ConnectResponse, ExportResponse, InspectPayload, InspectResponse,
OperationState, QueryResponse, SchemaItem, TableItem,
OperationState, QueryResponse, SchemaAvailability, SchemaItem, TableItem,
};
use db_config::ConnectionProfile;
use db_core::{
@@ -794,7 +794,13 @@ fn render_query_text(response: &QueryResponse) -> String {
}
fn render_schema(schema: &SchemaItem) -> String {
schema.name.clone()
match schema.availability {
SchemaAvailability::Ready => schema.name.clone(),
SchemaAvailability::Restricted => match &schema.note {
Some(note) => format!("{} [restricted] - {}", schema.name, note),
None => format!("{} [restricted]", schema.name),
},
}
}
fn render_table(table: &TableItem) -> String {
@@ -820,6 +826,22 @@ mod tests {
#[cfg(unix)]
use std::{fs::Permissions, os::unix::fs::PermissionsExt};
#[test]
fn render_schema_marks_restricted_entries() {
let rendered = render_schema(&SchemaItem {
name: String::from("restricted_probe"),
availability: SchemaAvailability::Restricted,
note: Some(String::from(
"schema access is restricted: restricted_probe",
)),
});
assert_eq!(
rendered,
"restricted_probe [restricted] - schema access is restricted: restricted_probe"
);
}
#[test]
fn parse_query_args_collects_params() {
let args = vec![