Database tree
The tree view (components/database-tree.tsx and components/schema-tree.tsx) organizes your database objects hierarchically:
Expanding nodes
Click any node to expand or collapse it:- Server nodes: Show all databases on that server
- Database nodes: Show all schemas in that database
- Schema nodes: Show tables and views
- Table/View nodes: Open in the table viewer
The schema tree uses lazy loading to fetch data only when you expand a node, keeping the initial load fast.
Object types
The explorer displays different icons for each object type:| Icon | Type | Description |
|---|---|---|
| 🗄️ | Server | PostgreSQL server connection |
| 💾 | Database | Individual database |
| 📁 | Schema | Schema (namespace) |
| 📊 | Table | Data table |
| 👁️ | View | Database view |
| 🔍 | Materialized View | Materialized view |
Table information
Hover over any table or view to see quick information:- Row count: Approximate number of rows
- Size: Disk space used
- Columns: Number of columns
- Created: Creation timestamp
Context menu
Right-click any object to access context menu options:Table operations
- Open in Table Viewer: View table data
- Open in Query Tool: Generate SELECT query
- View Schema: Show table structure
- Edit Table: Modify columns and constraints
- Export Data: Export table contents
- Drop Table: Delete the table
Database operations
- Refresh: Reload the schema tree
- Create Schema: Add a new schema
- Create Table: Open table designer
- Create View: Open view creator
Creating objects
Create schema
- Right-click a database node
- Select Create Schema
- Enter schema name and optional owner
- Click Create
Create table
- Right-click a schema node
- Select Create Table
- Use the table designer to define:
- Table name
- Columns (name, type, constraints)
- Primary key
- Indexes
- Foreign keys
- Click Create Table
Create view
- Right-click a schema node
- Select Create View
- Enter view name and SQL query:
- Click Create View
Refreshing the tree
Refresh the schema tree to see recent changes:- Refresh all: Click the refresh button in the toolbar
- Refresh node: Right-click a node and select Refresh
The schema tree is cached for performance. Refresh after making schema changes outside Poge.
Filtering objects
Use the search box to filter visible objects:- Type in the search box at the top of the explorer
- Only matching tables, views, and schemas are shown
- Clear the search to show all objects
Schema comparison
Compare schemas between databases or servers:- Click Compare Schemas in the toolbar
- Select source and target databases
- View differences:
- Tables present in source but not target
- Tables with different columns
- Missing indexes
- Different constraints
- Generate migration SQL to sync schemas
components/schema-comparison.tsx) helps identify schema drift.
System catalogs
View PostgreSQL system catalogs:- pg_catalog: System tables and views
- information_schema: SQL standard metadata views
System schemas are hidden by default. Enable them in Settings → Display → Show system schemas.
Performance
The schema explorer uses several optimizations:Lazy loading
Nodes are loaded only when expanded, reducing initial load time and memory usage.Caching
Schema metadata is cached (lib/query-cache.ts) for 5 minutes:
- Subsequent expansions are instant
- Cache invalidated on schema changes
- Manual refresh available