feat: add column sort, SQL formatter, table stats, insert dialog, saved queries & sessions monitor
- Column sort by header click in table view (ASC/DESC/none cycle, server-side) - SQL formatter with Format button and Shift+Alt+F keybinding (sql-formatter) - Table size and row count display in schema tree via pg_class - Insert row dialog with column type hints and auto-skip for identity columns - Saved queries (bookmarks) with CRUD backend, sidebar panel, and save dialog - Active sessions monitor (pg_stat_activity) with auto-refresh, cancel & terminate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -79,6 +79,19 @@ pub struct TablePrivilege {
|
||||
pub is_grantable: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct SessionInfo {
|
||||
pub pid: i32,
|
||||
pub usename: Option<String>,
|
||||
pub datname: Option<String>,
|
||||
pub state: Option<String>,
|
||||
pub query: Option<String>,
|
||||
pub query_start: Option<String>,
|
||||
pub wait_event_type: Option<String>,
|
||||
pub wait_event: Option<String>,
|
||||
pub client_addr: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
pub struct GrantRevokeParams {
|
||||
pub action: String,
|
||||
|
||||
@@ -2,4 +2,5 @@ pub mod connection;
|
||||
pub mod history;
|
||||
pub mod management;
|
||||
pub mod query_result;
|
||||
pub mod saved_queries;
|
||||
pub mod schema;
|
||||
|
||||
10
src-tauri/src/models/saved_queries.rs
Normal file
10
src-tauri/src/models/saved_queries.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct SavedQuery {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub sql: String,
|
||||
pub connection_id: Option<String>,
|
||||
pub created_at: String,
|
||||
}
|
||||
@@ -5,6 +5,8 @@ pub struct SchemaObject {
|
||||
pub name: String,
|
||||
pub object_type: String,
|
||||
pub schema: String,
|
||||
pub row_count: Option<i64>,
|
||||
pub size_bytes: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -18,6 +20,15 @@ pub struct ColumnInfo {
|
||||
pub is_primary_key: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ColumnDetail {
|
||||
pub column_name: String,
|
||||
pub data_type: String,
|
||||
pub is_nullable: bool,
|
||||
pub column_default: Option<String>,
|
||||
pub is_identity: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ConstraintInfo {
|
||||
pub name: String,
|
||||
|
||||
Reference in New Issue
Block a user