Add new version of pgmanager#47
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new PostgreSQL management implementation (pgmanager/), expands the (currently ignored-by-Go) next-generation manager implementation under pkg/_manager/, updates the cmd/pgmanager entrypoint to use the go-server command framework, and adds HTTP error mapping to the core pg package.
Changes:
- Add a new
pgmanager/module (manager, HTTP handlers, HTTP client, and CLI commands) including health, database, and connection operations plus OTEL metrics/spans. - Add new manager/schema/httpclient/httphandler code under
pkg/_manager/(in an underscore-prefixed folder). - Add
pg.HTTPErrormapping, and bump several dependencies ingo.mod.
Reviewed changes
Copilot reviewed 25 out of 122 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/test/main.go | Removes (comments out) manager test helper code and associated import. |
| pkg/_manager/tablespace.go | Adds tablespace CRUD logic (in underscore-prefixed directory). |
| pkg/_manager/statement.go | Adds pg_stat_statements listing/reset API (underscore-prefixed directory). |
| pkg/_manager/statement_test.go | Adds integration tests for statement stats (underscore-prefixed directory). |
| pkg/_manager/setting.go | Adds server settings list/get/update/reload methods (underscore-prefixed directory). |
| pkg/_manager/schema/statement.go | Adds statement schema types + SQL builder for pg_stat_statements (underscore-prefixed directory). |
| pkg/_manager/schema/setting.go | Adds settings schema types + SQL for pg_settings and ALTER SYSTEM (underscore-prefixed directory). |
| pkg/_manager/schema/setting_test.go | Adds unit tests for settings SQL selection and stringify (underscore-prefixed directory). |
| pkg/_manager/schema/globals.go | Adds shared constants and extension bootstrap helpers (underscore-prefixed directory). |
| pkg/_manager/schema/doc.go | Adds package documentation for manager schema (underscore-prefixed directory). |
| pkg/_manager/schema/connection.go | Adds connection schema + SQL for pg_stat_activity (underscore-prefixed directory). |
| pkg/_manager/schema/connection_test.go | Adds unit tests for connection schema selection logic (underscore-prefixed directory). |
| pkg/_manager/role.go | Adds role CRUD/update logic (underscore-prefixed directory). |
| pkg/_manager/replicationslot.go | Adds replication slot CRUD logic (underscore-prefixed directory). |
| pkg/_manager/README.md | Adds documentation for the manager package architecture and usage (underscore-prefixed directory). |
| pkg/_manager/object.go | Adds cross-database object listing/get logic (underscore-prefixed directory). |
| pkg/_manager/object_test.go | Adds integration tests for object list/get (underscore-prefixed directory). |
| pkg/_manager/manager.go | Adds manager constructor/bootstrap and internal iterators (underscore-prefixed directory). |
| pkg/_manager/httphandler/tablespace.go | Adds REST handlers for tablespace endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/statement.go | Adds REST handlers for statement stats endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/setting.go | Adds REST handlers for server setting endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/schema.go | Adds REST handlers for schema endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/role.go | Adds REST handlers for role endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/replicationslot.go | Adds REST handlers for replication slot endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/object.go | Adds REST handlers for object listing/get endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/httphandler.go | Adds handler registration and pg→HTTP error mapping (underscore-prefixed directory). |
| pkg/_manager/httphandler/frontend_included.go | Adds embedded-frontend serving behind frontend build tag (underscore-prefixed directory). |
| pkg/_manager/httphandler/frontend_excluded.go | Adds fallback frontend handler when frontend tag is off (underscore-prefixed directory). |
| pkg/_manager/httphandler/extension.go | Adds REST handlers for extension endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/doc.go | Adds package documentation for manager HTTP handlers (underscore-prefixed directory). |
| pkg/_manager/httphandler/database.go | Adds REST handlers for database endpoints (underscore-prefixed directory). |
| pkg/_manager/httphandler/connection.go | Adds REST handlers for connection endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/tablespace.go | Adds typed HTTP client for tablespace endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/statement.go | Adds typed HTTP client for statement endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/setting.go | Adds typed HTTP client for setting endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/schema.go | Adds typed HTTP client for schema endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/role.go | Adds typed HTTP client for role endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/replicationslot.go | Adds typed HTTP client for replication slot endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/opts.go | Adds query option helpers for typed HTTP clients (underscore-prefixed directory). |
| pkg/_manager/httpclient/object.go | Adds typed HTTP client for object endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/extension.go | Adds typed HTTP client for extension endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/doc.go | Adds package docs for manager HTTP client (underscore-prefixed directory). |
| pkg/_manager/httpclient/database.go | Adds typed HTTP client for database endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/connection.go | Adds typed HTTP client for connection endpoints (underscore-prefixed directory). |
| pkg/_manager/httpclient/client.go | Adds constructor wrapper for the HTTP client (underscore-prefixed directory). |
| pkg/_manager/extension.go | Adds extension list/get/create/update/delete logic (underscore-prefixed directory). |
| pkg/_manager/doc.go | Adds package documentation for manager APIs (underscore-prefixed directory). |
| pkg/_manager/connection.go | Adds connection list/get/delete logic (underscore-prefixed directory). |
| pkg/_manager/connection_test.go | Adds integration tests for connection APIs (underscore-prefixed directory). |
| pgmanager/schema/globals.go | Adds pgmanager schema globals/constants. |
| pgmanager/schema/connection.go | Adds pgmanager connection types, SQL selection, and client query helpers. |
| pgmanager/schema/cluster.go | Adds schema and SQL to retrieve cluster name. |
| pgmanager/manager/status.go | Adds manager Ping with OTEL span. |
| pgmanager/manager/opt.go | Adds options for tracer/meter/cluster naming. |
| pgmanager/manager/metrics.go | Adds OTEL gauge registration for database size and connection counts. |
| pgmanager/manager/manager.go | Adds pgmanager constructor, cluster lookup, and metric registration. |
| pgmanager/manager/connection.go | Adds list/get/delete connection methods with spans and pagination clamp. |
| pgmanager/httphandlers/status.go | Adds health handler registration and Ping endpoint. |
| pgmanager/httphandlers/database.go | Adds OpenAPI-described database handlers. |
| pgmanager/httphandlers/connection.go | Adds OpenAPI-described connection handlers. |
| pgmanager/httpclient/status.go | Adds HTTP client Ping. |
| pgmanager/httpclient/database.go | Adds HTTP client database CRUD. |
| pgmanager/httpclient/connection.go | Adds HTTP client connection list/get/delete. |
| pgmanager/httpclient/client.go | Adds pgmanager HTTP client constructor. |
| pgmanager/cmd/server.go | Adds server command to run the pgmanager API server. |
| pgmanager/cmd/client.go | Adds client commands for ping/databases/connections. |
| go.mod | Updates Go/module dependencies (pgx, go-server, otel, x/sync, etc.). |
| error.go | Adds HTTP error mapping and SQLSTATE handling updates to core pg errors. |
| cmd/pgmanager/main.go | Switches pgmanager CLI to go-server/pkg/cmd entrypoint and wiring. |
| cmd/_pgmanager2/version.go | Adds legacy/alternate CLI version command (underscore-prefixed directory). |
| cmd/_pgmanager2/tablespace.go | Adds legacy/alternate CLI tablespace commands (underscore-prefixed directory). |
| cmd/_pgmanager2/statement.go | Adds legacy/alternate CLI statement commands (underscore-prefixed directory). |
| cmd/_pgmanager2/setting.go | Adds legacy/alternate CLI setting commands (underscore-prefixed directory). |
| cmd/_pgmanager2/server.go | Adds legacy/alternate CLI server command (underscore-prefixed directory). |
| cmd/_pgmanager2/schema.go | Adds legacy/alternate CLI schema commands (underscore-prefixed directory). |
| cmd/_pgmanager2/replicationslot.go | Adds legacy/alternate CLI replication slot commands (underscore-prefixed directory). |
| cmd/_pgmanager2/object.go | Adds legacy/alternate CLI object commands (underscore-prefixed directory). |
| cmd/_pgmanager2/main.go | Adds legacy/alternate CLI entrypoint (underscore-prefixed directory). |
| cmd/_pgmanager2/extension.go | Adds legacy/alternate CLI extension commands (underscore-prefixed directory). |
| cmd/_pgmanager2/database.go | Adds legacy/alternate CLI database commands (underscore-prefixed directory). |
| cmd/_pgmanager2/connection.go | Adds legacy/alternate CLI connection commands (underscore-prefixed directory). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Coverage for this change: 65.3% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.