Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion apps/tauri/src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::connection::{
ConnectionConfig, ConnectionError, ConnectionId, ConnectionManager, ConnectionRegistry,
SchemaObject, SchemaObjectKind, SqlObjectKind, SqlObjectNode, SqliteOverview, TableSchema,
PostgresObjectDetail, SchemaObject, SchemaObjectKind, SqlObjectKind, SqlObjectNode,
SqliteOverview, TableSchema,
};
use crate::profiles::{ConnectionProfile, ProfileStore, ProfileStoreError};
use crate::secrets::SharedSecretStore;
Expand Down Expand Up @@ -273,6 +274,16 @@ pub fn db_describe_object(
registry.describe_object(&id, &object_id)
}

/// Postgres function / sequence / index / trigger / type detail (or schema listing).
#[tauri::command]
pub fn db_postgres_object_detail(
id: ConnectionId,
object_id: String,
registry: State<'_, ConnectionRegistry>,
) -> Result<PostgresObjectDetail, ConnectionError> {
registry.postgres_object_detail(&id, &object_id)
}

/// Shim: schema names via object tree roots.
#[tauri::command]
pub fn db_list_schemas(
Expand Down
11 changes: 11 additions & 0 deletions apps/tauri/src-tauri/src/connection/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ impl ConnectionRegistry {
}
}

/// Postgres function / sequence / index / trigger / type detail (or schema listing).
pub fn postgres_object_detail(
&self,
id: &ConnectionId,
object_id: &str,
) -> ConnectionResult<super::postgres_object_detail::PostgresObjectDetail> {
self.with_postgres(id, |s| {
super::postgres_object_detail::fetch_detail(s, object_id)
})
}

/// Driver-agnostic object tree for a live connection (SQLite first).
pub fn object_tree(
&self,
Expand Down
2 changes: 2 additions & 0 deletions apps/tauri/src-tauri/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod introspect;
mod manager;
mod object_tree;
mod postgres;
mod postgres_object_detail;
mod postgres_object_tree;
pub(crate) mod postgres_query;
mod query;
Expand All @@ -22,5 +23,6 @@ pub use id::{ConnectionId, DriverKind};
pub use introspect::{ColumnMeta, SchemaObject, SchemaObjectKind, TableSchema};
pub use manager::{ConnectionConfig, ConnectionManager, ConnectionRegistry};
pub use object_tree::{ObjectTreeProvider, SqlObjectKind, SqlObjectNode};
pub use postgres_object_detail::PostgresObjectDetail;
pub use query::QueryEvent;
pub use sqlite_introspect::SqliteOverview;
Loading
Loading