fastpluggy-postgres-tools 0.1.13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fastpluggy-postgres-tools might be problematic. Click here for more details.

Files changed (25) hide show
  1. fastpluggy_postgres_tools-0.1.13/PKG-INFO +155 -0
  2. fastpluggy_postgres_tools-0.1.13/README.md +145 -0
  3. fastpluggy_postgres_tools-0.1.13/fastpluggy_postgres_tools.egg-info/PKG-INFO +155 -0
  4. fastpluggy_postgres_tools-0.1.13/fastpluggy_postgres_tools.egg-info/SOURCES.txt +23 -0
  5. fastpluggy_postgres_tools-0.1.13/fastpluggy_postgres_tools.egg-info/dependency_links.txt +1 -0
  6. fastpluggy_postgres_tools-0.1.13/fastpluggy_postgres_tools.egg-info/entry_points.txt +2 -0
  7. fastpluggy_postgres_tools-0.1.13/fastpluggy_postgres_tools.egg-info/requires.txt +2 -0
  8. fastpluggy_postgres_tools-0.1.13/fastpluggy_postgres_tools.egg-info/top_level.txt +1 -0
  9. fastpluggy_postgres_tools-0.1.13/pyproject.toml +30 -0
  10. fastpluggy_postgres_tools-0.1.13/setup.cfg +4 -0
  11. fastpluggy_postgres_tools-0.1.13/src/__init__.py +1 -0
  12. fastpluggy_postgres_tools-0.1.13/src/plugin.py +28 -0
  13. fastpluggy_postgres_tools-0.1.13/src/routers/__init__.py +25 -0
  14. fastpluggy_postgres_tools-0.1.13/src/routers/alerts.py +371 -0
  15. fastpluggy_postgres_tools-0.1.13/src/routers/connections.py +117 -0
  16. fastpluggy_postgres_tools-0.1.13/src/routers/dashboard.py +321 -0
  17. fastpluggy_postgres_tools-0.1.13/src/routers/db_size.py +142 -0
  18. fastpluggy_postgres_tools-0.1.13/src/routers/indexes.py +75 -0
  19. fastpluggy_postgres_tools-0.1.13/src/routers/queries.py +148 -0
  20. fastpluggy_postgres_tools-0.1.13/src/routers/replication.py +200 -0
  21. fastpluggy_postgres_tools-0.1.13/src/routers/sequences.py +78 -0
  22. fastpluggy_postgres_tools-0.1.13/src/routers/tables.py +106 -0
  23. fastpluggy_postgres_tools-0.1.13/src/routers/vacuum.py +221 -0
  24. fastpluggy_postgres_tools-0.1.13/src/utils/__init__.py +11 -0
  25. fastpluggy_postgres_tools-0.1.13/src/utils/db_utils.py +104 -0
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastpluggy-postgres-tools
3
+ Version: 0.1.13
4
+ Summary: PostgreSQL database monitoring and management plugin for FastPluggy
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: sqlalchemy>=2.0.0
9
+ Requires-Dist: fastpluggy-ui-tools>=0.0.4
10
+
11
+ # Postgres Tools for FastPluggy
12
+
13
+ ![Postgres Tools](https://img.shields.io/badge/FastPluggy-Postgres%20Tools-blue)
14
+ ![Version](https://img.shields.io/badge/version-0.1.13-blue)
15
+
16
+ A powerful PostgreSQL database monitoring and management plugin for FastPluggy applications.
17
+ This plugin provides a user-friendly interface to monitor and manage various aspects of your PostgreSQL databases.
18
+
19
+ ## Features
20
+
21
+ ### Implemented Features
22
+
23
+ - **PostgreSQL Sequences Monitoring**:
24
+ - View comprehensive sequence information including name, last value, max value, and remaining capacity
25
+ - Monitor sequence usage with percentage metrics (percent used and percent remaining)
26
+ - Identify sequences that are close to reaching their maximum value
27
+ - Filter sequences by schema (excludes system schemas like pg_catalog and information_schema)
28
+ - Sort sequences by remaining capacity to prioritize attention
29
+
30
+ - **Database Size & Tablespace Usage**:
31
+ - View total database size and breakdown by schema and tablespace
32
+ - Identify the largest tables in your database
33
+ - See detailed size information for tables and their indexes
34
+ - Filter by schema and include/exclude system schemas
35
+ - Sort by size to identify storage usage patterns
36
+
37
+ - **Index Usage Statistics**:
38
+ - Track per-index scan counts and rows read
39
+ - Highlight unused indexes below a scan threshold
40
+ - Show index sizes and offer one-click drop operations
41
+ - Filter by schema (excludes system schemas like pg_catalog and information_schema)
42
+ - Sort by scan count to identify unused indexes
43
+
44
+ - **Table Statistics & Bloat**:
45
+ - Monitor table health by reporting live vs. dead rows
46
+ - Estimate bloat percentage and show disk size
47
+ - Surface last vacuum/analyze times
48
+ - Optional pgstattuple integration for exact bloat measurement
49
+ - Highlight tables with high bloat percentage
50
+ - Filter by schema (excludes system schemas like pg_catalog and information_schema)
51
+
52
+ - **Query Performance Analysis**:
53
+ - Leverage pg_stat_statements to list top slow queries
54
+ - View queries by total/mean time
55
+ - Option to include 95th percentile statistics
56
+ - Automatic detection of pg_stat_statements extension
57
+ - Installation instructions if extension is not available
58
+
59
+ - **Connection & Lock Monitoring**:
60
+ - Display all active sessions (state, duration, query)
61
+ - Show current lock contention
62
+ - Flag long-running queries
63
+ - Filter connections by minimum duration and state
64
+ - View detailed information about blocking and waiting queries
65
+
66
+ - **Vacuum/Autovacuum Status**:
67
+ - Show last manual/autovacuum times per table
68
+ - Display dead-tuple counts
69
+ - Monitor live progress of ongoing autovacuum jobs
70
+ - View autovacuum settings
71
+ - Highlight tables that haven't been vacuumed recently
72
+ - **NEW**: Trigger manual vacuum operations with one-click buttons
73
+ - **NEW**: Support for both regular VACUUM ANALYZE and VACUUM FULL ANALYZE operations
74
+ - **NEW**: Built-in confirmation dialogs for safety
75
+
76
+ - **Replication & Backups**:
77
+ - Report replication status and lag metrics (write_lag, replay_lag)
78
+ - Track backup history and recency
79
+ - Alert for stale backups or high lag
80
+ - Detect primary/replica status automatically
81
+ - Show replication slots and retained WAL size
82
+
83
+ - **Custom Hooks & Webhooks**:
84
+ - Define threshold-based alerts on any metric
85
+ - Post notifications to Slack, Discord, Microsoft Teams, PagerDuty, or custom endpoints
86
+ - Test webhook functionality
87
+ - Enable/disable alerts individually
88
+ - Store alert configuration in the database
89
+
90
+ - **Global Dashboard & Recommendations**:
91
+ - One-page health overview with combined alert list
92
+ - Actionable recommendations for database improvements
93
+ - Extension installation suggestions
94
+ - Database configuration recommendations
95
+ - Key metrics summary
96
+
97
+ ### Planned Features
98
+
99
+ For detailed specifications of each feature, see the individual files in the `docs/feature/` directory.
100
+
101
+ ## Installation
102
+
103
+ Install the official plugin package:
104
+
105
+ ```bash
106
+ pip install fastpluggy-postgres-tools
107
+ ```
108
+
109
+ ## Configuration
110
+
111
+ The plugin uses the same database connection that is configured for your FastPluggy application.
112
+ No additional configuration is required if your application is already connected to a PostgreSQL database.
113
+
114
+ ## Usage
115
+
116
+ ### Web Interface
117
+
118
+ Once installed, access the PostgreSQL tools at `/postgres/` in your FastPluggy application. The interface allows you to:
119
+
120
+ 1. View detailed information about PostgreSQL sequences
121
+ 2. Monitor sequence usage and remaining capacity
122
+ 3. Identify sequences that may need attention (approaching maximum value)
123
+ 4. View database size information and breakdown by schema and tablespace
124
+ 5. Identify the largest tables in your database
125
+ 6. Monitor storage usage patterns
126
+
127
+ ### API Access
128
+
129
+ The plugin also provides API endpoints for programmatic access to all features. See the [API Endpoints Documentation](docs/api-endpoints.md) for details on available endpoints, parameters, and response formats.
130
+
131
+ ## Development
132
+
133
+ ### Requirements
134
+
135
+ - Python 3.10+
136
+ - FastPluggy
137
+ - SQLAlchemy 2.0.0+
138
+ - PostgreSQL database
139
+
140
+ ### Setup
141
+
142
+ 1. Clone the repository
143
+ 2. Install dependencies: `pip install -e .`
144
+ 3. Run your FastPluggy application with this plugin enabled
145
+
146
+ ### Building
147
+
148
+ ```bash
149
+ python -m build
150
+ ```
151
+
152
+
153
+ ## License
154
+
155
+ This project is licensed under the MIT License.
@@ -0,0 +1,145 @@
1
+ # Postgres Tools for FastPluggy
2
+
3
+ ![Postgres Tools](https://img.shields.io/badge/FastPluggy-Postgres%20Tools-blue)
4
+ ![Version](https://img.shields.io/badge/version-0.1.13-blue)
5
+
6
+ A powerful PostgreSQL database monitoring and management plugin for FastPluggy applications.
7
+ This plugin provides a user-friendly interface to monitor and manage various aspects of your PostgreSQL databases.
8
+
9
+ ## Features
10
+
11
+ ### Implemented Features
12
+
13
+ - **PostgreSQL Sequences Monitoring**:
14
+ - View comprehensive sequence information including name, last value, max value, and remaining capacity
15
+ - Monitor sequence usage with percentage metrics (percent used and percent remaining)
16
+ - Identify sequences that are close to reaching their maximum value
17
+ - Filter sequences by schema (excludes system schemas like pg_catalog and information_schema)
18
+ - Sort sequences by remaining capacity to prioritize attention
19
+
20
+ - **Database Size & Tablespace Usage**:
21
+ - View total database size and breakdown by schema and tablespace
22
+ - Identify the largest tables in your database
23
+ - See detailed size information for tables and their indexes
24
+ - Filter by schema and include/exclude system schemas
25
+ - Sort by size to identify storage usage patterns
26
+
27
+ - **Index Usage Statistics**:
28
+ - Track per-index scan counts and rows read
29
+ - Highlight unused indexes below a scan threshold
30
+ - Show index sizes and offer one-click drop operations
31
+ - Filter by schema (excludes system schemas like pg_catalog and information_schema)
32
+ - Sort by scan count to identify unused indexes
33
+
34
+ - **Table Statistics & Bloat**:
35
+ - Monitor table health by reporting live vs. dead rows
36
+ - Estimate bloat percentage and show disk size
37
+ - Surface last vacuum/analyze times
38
+ - Optional pgstattuple integration for exact bloat measurement
39
+ - Highlight tables with high bloat percentage
40
+ - Filter by schema (excludes system schemas like pg_catalog and information_schema)
41
+
42
+ - **Query Performance Analysis**:
43
+ - Leverage pg_stat_statements to list top slow queries
44
+ - View queries by total/mean time
45
+ - Option to include 95th percentile statistics
46
+ - Automatic detection of pg_stat_statements extension
47
+ - Installation instructions if extension is not available
48
+
49
+ - **Connection & Lock Monitoring**:
50
+ - Display all active sessions (state, duration, query)
51
+ - Show current lock contention
52
+ - Flag long-running queries
53
+ - Filter connections by minimum duration and state
54
+ - View detailed information about blocking and waiting queries
55
+
56
+ - **Vacuum/Autovacuum Status**:
57
+ - Show last manual/autovacuum times per table
58
+ - Display dead-tuple counts
59
+ - Monitor live progress of ongoing autovacuum jobs
60
+ - View autovacuum settings
61
+ - Highlight tables that haven't been vacuumed recently
62
+ - **NEW**: Trigger manual vacuum operations with one-click buttons
63
+ - **NEW**: Support for both regular VACUUM ANALYZE and VACUUM FULL ANALYZE operations
64
+ - **NEW**: Built-in confirmation dialogs for safety
65
+
66
+ - **Replication & Backups**:
67
+ - Report replication status and lag metrics (write_lag, replay_lag)
68
+ - Track backup history and recency
69
+ - Alert for stale backups or high lag
70
+ - Detect primary/replica status automatically
71
+ - Show replication slots and retained WAL size
72
+
73
+ - **Custom Hooks & Webhooks**:
74
+ - Define threshold-based alerts on any metric
75
+ - Post notifications to Slack, Discord, Microsoft Teams, PagerDuty, or custom endpoints
76
+ - Test webhook functionality
77
+ - Enable/disable alerts individually
78
+ - Store alert configuration in the database
79
+
80
+ - **Global Dashboard & Recommendations**:
81
+ - One-page health overview with combined alert list
82
+ - Actionable recommendations for database improvements
83
+ - Extension installation suggestions
84
+ - Database configuration recommendations
85
+ - Key metrics summary
86
+
87
+ ### Planned Features
88
+
89
+ For detailed specifications of each feature, see the individual files in the `docs/feature/` directory.
90
+
91
+ ## Installation
92
+
93
+ Install the official plugin package:
94
+
95
+ ```bash
96
+ pip install fastpluggy-postgres-tools
97
+ ```
98
+
99
+ ## Configuration
100
+
101
+ The plugin uses the same database connection that is configured for your FastPluggy application.
102
+ No additional configuration is required if your application is already connected to a PostgreSQL database.
103
+
104
+ ## Usage
105
+
106
+ ### Web Interface
107
+
108
+ Once installed, access the PostgreSQL tools at `/postgres/` in your FastPluggy application. The interface allows you to:
109
+
110
+ 1. View detailed information about PostgreSQL sequences
111
+ 2. Monitor sequence usage and remaining capacity
112
+ 3. Identify sequences that may need attention (approaching maximum value)
113
+ 4. View database size information and breakdown by schema and tablespace
114
+ 5. Identify the largest tables in your database
115
+ 6. Monitor storage usage patterns
116
+
117
+ ### API Access
118
+
119
+ The plugin also provides API endpoints for programmatic access to all features. See the [API Endpoints Documentation](docs/api-endpoints.md) for details on available endpoints, parameters, and response formats.
120
+
121
+ ## Development
122
+
123
+ ### Requirements
124
+
125
+ - Python 3.10+
126
+ - FastPluggy
127
+ - SQLAlchemy 2.0.0+
128
+ - PostgreSQL database
129
+
130
+ ### Setup
131
+
132
+ 1. Clone the repository
133
+ 2. Install dependencies: `pip install -e .`
134
+ 3. Run your FastPluggy application with this plugin enabled
135
+
136
+ ### Building
137
+
138
+ ```bash
139
+ python -m build
140
+ ```
141
+
142
+
143
+ ## License
144
+
145
+ This project is licensed under the MIT License.
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: fastpluggy-postgres-tools
3
+ Version: 0.1.13
4
+ Summary: PostgreSQL database monitoring and management plugin for FastPluggy
5
+ License-Expression: MIT
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: sqlalchemy>=2.0.0
9
+ Requires-Dist: fastpluggy-ui-tools>=0.0.4
10
+
11
+ # Postgres Tools for FastPluggy
12
+
13
+ ![Postgres Tools](https://img.shields.io/badge/FastPluggy-Postgres%20Tools-blue)
14
+ ![Version](https://img.shields.io/badge/version-0.1.13-blue)
15
+
16
+ A powerful PostgreSQL database monitoring and management plugin for FastPluggy applications.
17
+ This plugin provides a user-friendly interface to monitor and manage various aspects of your PostgreSQL databases.
18
+
19
+ ## Features
20
+
21
+ ### Implemented Features
22
+
23
+ - **PostgreSQL Sequences Monitoring**:
24
+ - View comprehensive sequence information including name, last value, max value, and remaining capacity
25
+ - Monitor sequence usage with percentage metrics (percent used and percent remaining)
26
+ - Identify sequences that are close to reaching their maximum value
27
+ - Filter sequences by schema (excludes system schemas like pg_catalog and information_schema)
28
+ - Sort sequences by remaining capacity to prioritize attention
29
+
30
+ - **Database Size & Tablespace Usage**:
31
+ - View total database size and breakdown by schema and tablespace
32
+ - Identify the largest tables in your database
33
+ - See detailed size information for tables and their indexes
34
+ - Filter by schema and include/exclude system schemas
35
+ - Sort by size to identify storage usage patterns
36
+
37
+ - **Index Usage Statistics**:
38
+ - Track per-index scan counts and rows read
39
+ - Highlight unused indexes below a scan threshold
40
+ - Show index sizes and offer one-click drop operations
41
+ - Filter by schema (excludes system schemas like pg_catalog and information_schema)
42
+ - Sort by scan count to identify unused indexes
43
+
44
+ - **Table Statistics & Bloat**:
45
+ - Monitor table health by reporting live vs. dead rows
46
+ - Estimate bloat percentage and show disk size
47
+ - Surface last vacuum/analyze times
48
+ - Optional pgstattuple integration for exact bloat measurement
49
+ - Highlight tables with high bloat percentage
50
+ - Filter by schema (excludes system schemas like pg_catalog and information_schema)
51
+
52
+ - **Query Performance Analysis**:
53
+ - Leverage pg_stat_statements to list top slow queries
54
+ - View queries by total/mean time
55
+ - Option to include 95th percentile statistics
56
+ - Automatic detection of pg_stat_statements extension
57
+ - Installation instructions if extension is not available
58
+
59
+ - **Connection & Lock Monitoring**:
60
+ - Display all active sessions (state, duration, query)
61
+ - Show current lock contention
62
+ - Flag long-running queries
63
+ - Filter connections by minimum duration and state
64
+ - View detailed information about blocking and waiting queries
65
+
66
+ - **Vacuum/Autovacuum Status**:
67
+ - Show last manual/autovacuum times per table
68
+ - Display dead-tuple counts
69
+ - Monitor live progress of ongoing autovacuum jobs
70
+ - View autovacuum settings
71
+ - Highlight tables that haven't been vacuumed recently
72
+ - **NEW**: Trigger manual vacuum operations with one-click buttons
73
+ - **NEW**: Support for both regular VACUUM ANALYZE and VACUUM FULL ANALYZE operations
74
+ - **NEW**: Built-in confirmation dialogs for safety
75
+
76
+ - **Replication & Backups**:
77
+ - Report replication status and lag metrics (write_lag, replay_lag)
78
+ - Track backup history and recency
79
+ - Alert for stale backups or high lag
80
+ - Detect primary/replica status automatically
81
+ - Show replication slots and retained WAL size
82
+
83
+ - **Custom Hooks & Webhooks**:
84
+ - Define threshold-based alerts on any metric
85
+ - Post notifications to Slack, Discord, Microsoft Teams, PagerDuty, or custom endpoints
86
+ - Test webhook functionality
87
+ - Enable/disable alerts individually
88
+ - Store alert configuration in the database
89
+
90
+ - **Global Dashboard & Recommendations**:
91
+ - One-page health overview with combined alert list
92
+ - Actionable recommendations for database improvements
93
+ - Extension installation suggestions
94
+ - Database configuration recommendations
95
+ - Key metrics summary
96
+
97
+ ### Planned Features
98
+
99
+ For detailed specifications of each feature, see the individual files in the `docs/feature/` directory.
100
+
101
+ ## Installation
102
+
103
+ Install the official plugin package:
104
+
105
+ ```bash
106
+ pip install fastpluggy-postgres-tools
107
+ ```
108
+
109
+ ## Configuration
110
+
111
+ The plugin uses the same database connection that is configured for your FastPluggy application.
112
+ No additional configuration is required if your application is already connected to a PostgreSQL database.
113
+
114
+ ## Usage
115
+
116
+ ### Web Interface
117
+
118
+ Once installed, access the PostgreSQL tools at `/postgres/` in your FastPluggy application. The interface allows you to:
119
+
120
+ 1. View detailed information about PostgreSQL sequences
121
+ 2. Monitor sequence usage and remaining capacity
122
+ 3. Identify sequences that may need attention (approaching maximum value)
123
+ 4. View database size information and breakdown by schema and tablespace
124
+ 5. Identify the largest tables in your database
125
+ 6. Monitor storage usage patterns
126
+
127
+ ### API Access
128
+
129
+ The plugin also provides API endpoints for programmatic access to all features. See the [API Endpoints Documentation](docs/api-endpoints.md) for details on available endpoints, parameters, and response formats.
130
+
131
+ ## Development
132
+
133
+ ### Requirements
134
+
135
+ - Python 3.10+
136
+ - FastPluggy
137
+ - SQLAlchemy 2.0.0+
138
+ - PostgreSQL database
139
+
140
+ ### Setup
141
+
142
+ 1. Clone the repository
143
+ 2. Install dependencies: `pip install -e .`
144
+ 3. Run your FastPluggy application with this plugin enabled
145
+
146
+ ### Building
147
+
148
+ ```bash
149
+ python -m build
150
+ ```
151
+
152
+
153
+ ## License
154
+
155
+ This project is licensed under the MIT License.
@@ -0,0 +1,23 @@
1
+ README.md
2
+ pyproject.toml
3
+ fastpluggy_postgres_tools.egg-info/PKG-INFO
4
+ fastpluggy_postgres_tools.egg-info/SOURCES.txt
5
+ fastpluggy_postgres_tools.egg-info/dependency_links.txt
6
+ fastpluggy_postgres_tools.egg-info/entry_points.txt
7
+ fastpluggy_postgres_tools.egg-info/requires.txt
8
+ fastpluggy_postgres_tools.egg-info/top_level.txt
9
+ src/__init__.py
10
+ src/plugin.py
11
+ src/routers/__init__.py
12
+ src/routers/alerts.py
13
+ src/routers/connections.py
14
+ src/routers/dashboard.py
15
+ src/routers/db_size.py
16
+ src/routers/indexes.py
17
+ src/routers/queries.py
18
+ src/routers/replication.py
19
+ src/routers/sequences.py
20
+ src/routers/tables.py
21
+ src/routers/vacuum.py
22
+ src/utils/__init__.py
23
+ src/utils/db_utils.py
@@ -0,0 +1,2 @@
1
+ [fastpluggy.plugins]
2
+ postgres_tools = fastpluggy_plugin.postgres_tools.plugin:PostgresToolsModule
@@ -0,0 +1,2 @@
1
+ sqlalchemy>=2.0.0
2
+ fastpluggy-ui-tools>=0.0.4
@@ -0,0 +1,30 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "fastpluggy-postgres-tools"
7
+ version = "0.1.13"
8
+ readme = "README.md"
9
+ description = "PostgreSQL database monitoring and management plugin for FastPluggy"
10
+ requires-python = ">=3.10"
11
+ dependencies = [
12
+ "sqlalchemy>=2.0.0",
13
+ "fastpluggy-ui-tools>=0.0.4",
14
+ ]
15
+ license = "MIT"
16
+
17
+ [tool.setuptools]
18
+ packages = ["fastpluggy_plugin.postgres_tools"]
19
+ package-dir = { "fastpluggy_plugin.postgres_tools" = "src" }
20
+ include-package-data = true
21
+
22
+ [tool.setuptools.package-data]
23
+ "fastpluggy_plugin.postgres_tools" = ["**/*","templates/**/*.html", "templates/**/*.j2", "static/**/*"]
24
+
25
+ [project.entry-points."fastpluggy.plugins"]
26
+ postgres_tools = "fastpluggy_plugin.postgres_tools.plugin:PostgresToolsModule"
27
+
28
+ [tool.fastpluggy]
29
+ category = ['database']
30
+ keywords = ['database', 'postgres']
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1 @@
1
+ from .plugin import PostgresToolsModule
@@ -0,0 +1,28 @@
1
+ # plugin.py
2
+
3
+ from typing import Annotated, Any
4
+
5
+ from fastpluggy.core.module_base import FastPluggyBaseModule
6
+ from fastpluggy.core.tools.inspect_tools import InjectDependency
7
+ from fastpluggy.fastpluggy import FastPluggy
8
+
9
+
10
+ def get_router():
11
+ from .routers import postgres_tools_router
12
+ return postgres_tools_router
13
+
14
+
15
+ class PostgresToolsModule(FastPluggyBaseModule):
16
+ module_name: str = "postgres_tools"
17
+
18
+ module_menu_name: str = "Postgres"
19
+ module_menu_icon: str = "fas fa-database"
20
+
21
+ depends_on: dict = {
22
+ "ui_tools": ">=0.0.4",
23
+ }
24
+ module_router: Any = get_router
25
+
26
+ def on_load_complete(self, fast_pluggy: Annotated[FastPluggy, InjectDependency]) -> None:
27
+ # Menu items are now added using the @menu_entry decorator in the router files
28
+ pass
@@ -0,0 +1,25 @@
1
+ from fastapi import APIRouter, Depends
2
+
3
+ from fastpluggy.core.auth import require_authentication
4
+ from .sequences import sequences_router
5
+ from .db_size import db_size_router
6
+ from .indexes import indexes_router
7
+ from .tables import tables_router
8
+ from .queries import queries_router
9
+ from .connections import connections_router
10
+ from .vacuum import vacuum_router
11
+ from .replication import replication_router
12
+ from .alerts import alerts_router
13
+ from .dashboard import dashboard_router
14
+
15
+ postgres_tools_router = APIRouter()
16
+ postgres_tools_router.include_router(sequences_router, dependencies=[Depends(require_authentication)])
17
+ postgres_tools_router.include_router(db_size_router, dependencies=[Depends(require_authentication)])
18
+ postgres_tools_router.include_router(indexes_router, dependencies=[Depends(require_authentication)])
19
+ postgres_tools_router.include_router(tables_router, dependencies=[Depends(require_authentication)])
20
+ postgres_tools_router.include_router(queries_router, dependencies=[Depends(require_authentication)])
21
+ postgres_tools_router.include_router(connections_router, dependencies=[Depends(require_authentication)])
22
+ postgres_tools_router.include_router(vacuum_router, dependencies=[Depends(require_authentication)])
23
+ postgres_tools_router.include_router(replication_router, dependencies=[Depends(require_authentication)])
24
+ postgres_tools_router.include_router(alerts_router, dependencies=[Depends(require_authentication)])
25
+ postgres_tools_router.include_router(dashboard_router, dependencies=[Depends(require_authentication)])