PostgreSQL deployments written in SQL, tested before they commit. Your deploy.sql decides what runs; a test tree can gate the COMMIT; coding agents get MCP tools and project skills.
Diagnoses a failed pgmi deploy in a pgmi project. Maps the exit code and the SQLSTATE to what to inspect and how to fix it, reads the --json failure record, and tells whether anything was committed. Use when pgmi deploy exits non-zero, when a test fails the deploy, when an error names no file, or when a deploy…
Designs a pgmi project and its deploy.sql. Covers which decisions belong in deploy.sql rather than in a CLI flag, choosing transaction boundaries and phases, making every redeploy converge onto a database that already holds data, building a preview or dry run in SQL through a parameter, and modelling the application…
The two layers of a pgmi database — physical (tables, keys, constraints, indexes, policies in run-once files, written in final form and frozen once a kept database ran them) and semantic (views as the only read surface, writer functions as the only writers, problem and problems refusal functions, one rule in one…
Explains pgmi-meta blocks, the XML header in a pgmi project's SQL files that carries a script id, an idempotent flag and sortKeys. Covers how pgmi turns them into the order of pgmiplanview, multi-phase keys, file identity across renames, and the pgmi metadata plan, validate and scaffold commands. Use when adding or…
Writes and reviews SQL and PL/pgSQL for a pgmi project — deploy.sql logic that selects and EXECUTEs project files from the session views, functions and procedures, schema changes (run-once by default, re-runnable when deploy.sql re-runs structure), dynamic SQL with format(), error handling that keeps pgmi's failure…
Writes, places and debugs tests in a pgmi project. Covers where test files and setup.sql fixtures go in test/ directories, how CALL pgmitest() runs them inside savepoints and rolls them back, what each test can see, running a subset by pattern, test callbacks, and assertions that cannot pass by accident. Use when…
Runs the change loop of a pgmi project — edit a file, deploy, read the failure, fix and deploy again — and says where a new file goes and where to look up the session API instead of guessing. Use before the first deploy in a session, when unsure where a new file belongs, or when asked to make a change and see it…
PostgreSQL recipes for reports, counts and aggregates computed inside the database. Covers conditional aggregates with FILTER, subtotals and grand totals with GROUPING SETS, ROLLUP, CUBE and GROUPING(), window functions for running totals, rank within a group, previous row with lag and latest row per group with…
PostgreSQL recipes for recording and reacting to data changes - an audit table filled by triggers (old and new rows as jsonb, actor, transition tables), publications and logical replication slots for an external change feed or CDC, and LISTEN/NOTIFY with pgnotify for in-app signals. Use when asked to audit or log who…
PostgreSQL recipes for concurrent writers - a work queue in a table claimed with SELECT FOR UPDATE SKIP LOCKED, advisory locks (pgadvisoryxactlock, pgtryadvisorylock) so only one runner works at a time, and upserts with INSERT ON CONFLICT versus MERGE. Use when building a job queue or background workers, preventing a…
PostgreSQL recipes for choosing, adding and reviewing indexes. Covers indexing foreign key columns and finding unindexed foreign keys, covering indexes with INCLUDE for index-only scans, expression indexes such as lower(email) or a jsonb key, BRIN indexes for large append-only time-ordered tables, and CREATE INDEX…
PostgreSQL recipes that make the database itself enforce business rules instead of application code or validation triggers. Covers partial unique indexes (one active row per key), exclusion constraints with btreegist (no overlapping bookings or date ranges per key), deferrable foreign keys and unique constraints…
PostgreSQL recipes for restricting which rows or functions a role can reach. Covers row-level security for tenant isolation (ENABLE and FORCE ROW LEVEL SECURITY, policies with USING and WITH CHECK, a tenant setting, who bypasses policies) and function privileges (the default EXECUTE grant to PUBLIC, REVOKE, ALTER…
PostgreSQL recipes for storing times, dates and validity periods. Covers timestamptz versus timestamp and date, time zones and AT TIME ZONE, what now() returns inside a deploy or test versus clocktimestamp(), and tstzrange or daterange columns with containment, overlap and half-open bounds. Use when adding a timestamp…
Tables, kernels and business rules in this advanced-template project, as an add-on to pgmi-layers — entity tables, composite tenant foreign keys, forced row-level security, catalogs, kernels as the only writers, per-entity problem refusal functions, views through core.ensureview, and the handlers on top that only…
The design rules of this advanced-template project's API — REST, RPC and MCP as three HTTP protocols over one handler registry, what the gateway does and what PostgreSQL does, identity from login, organization and connection sessions, access and permissions, roles and cross-organization kernels, one kernel per…
Adds a domain entity and its REST endpoints to this advanced-template project end to end — the run-once table file, the kernel functions, the handler registrations and the test, with their sort keys, access declaration and row-level security, plus the handler metadata keys (path templates, querySchema, inputSchema…
Writes and reviews REST handler bodies in this advanced-template project — the four phases (materialize, validate, probe, execute), safe casts with ?> and common.trycast, api.malformedparams, status codes and problem codes (400, 404, 409, 422), the handler-to-kernel contract, PATCH and PUT semantics, optimistic…
Designs and writes MCP tools, resources and prompts in PostgreSQL for this advanced-template project — task-level tools instead of table mirrors, one call and one snapshot per task, detail levels and paging, schemas and descriptions written for a model, answers as a briefing (hints, next actions, omitted), refusals…
★not rated 4
changed 12d agoA138 tokens
At most 3 mods per repository are shown here, and a mod shipped inside a plugin is left to that plugin's page — the rest are on their repository pages: