feat: sync shared pgpm modules with constructive-db main - #112
Merged
Conversation
Mirrors constructive-db main's pgpm-modules/ sources into the published copies (constructive-io/constructive-db#2684, #2689, #2690, #2701, #2703). Versions are untouched; publishing stays a manual step. - New @pgpm/errors module: jwt-claims now requires it (jwt_private.current_database_id raises DATABASE_CLAIM_REQUIRED through errors.raise_error instead of returning NULL), so the workspace was no longer self-contained without it. - jwt-claims: the current_* claim readers become LANGUAGE sql over pg_input_is_valid() instead of plpgsql EXCEPTION blocks, which opened a subtransaction on every call. - metaschema-modules: new pages_module; catalog_module gains the four sites_web_config/sites_error_pages/sites_app_links/sites_deep_links table id + name pairs and their FKs; FK-covering indexes added across the module tables. - metaschema-schema: new view/table/field/unique-constraint/foreign-key behavior tables; FK-covering indexes; database.schema_hash comment becomes '@behavior -*'. - app-scope, database-jobs, object-tree, achievements, base32, inflection, verify: source and test drift. - Fixed a stale revert in metaschema-schema field/table (dropped field_table_id_idx, which deploy no longer creates, so the full revert cycle failed), and the function-resolution catalog_module seed inserts, which omitted the four new NOT NULL DEFAULT uuid_nil() table id columns and tripped their FKs. - metaschema-modules snapshots refreshed for pages_module. - sql/<name>--<version>.sql + bundle artifacts regenerated for the changed modules.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
The portability suite's beforeAll deploys the full metaschema + app-scope + function-resolution closure, which now exceeds jest's 5s default hook timeout on CI runners. Matches metaschema-modules, whose config already sets 60s for the same reason.
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.
Summary
Mirrors constructive-db
main'spgpm-modules/sources into these published copies (constructive-db #2684, #2689/#2690, #2701, #2703). Versions untouched —lerna publishstays a manual step. The repo-local conventions are preserved:pgsql-test(notconstructive-test) imports, downstream0.34.0versions, and the extra READMEs.Adds
@pgpm/errors, which the workspace can no longer do without:jwt-claimsnow hard-fails on a missing database claim instead of returning NULL, so it requireserrors:Other substantive drift:
current_*claim reader drops itsEXCEPTION WHEN OTHERSwrapper forpg_input_is_valid(), which validates without raising, so the reads no longer open a subtransaction per call:LANGUAGE plpgsql STABLE→LANGUAGE sql STABLE(current_user_idalsoLEAKPROOF).pages_module;catalog_modulegains the foursites_web_config/sites_error_pages/sites_app_links/sites_deep_links_table_id+_table_namepairs and their FKs; FK-covering indexes added across the module tables (index count 459 → 476).view_behavior,table_behavior,field_behavior,unique_constraint_behavior,foreign_key_constraint_behaviortables; FK-covering indexes;database.schema_hashcomment'@omit'→'@behavior -*'.Two upstream bugs surfaced while validating and are fixed here (and in constructive-db, so the next sync stays a no-op):
metaschema-schemarevert/…/field/table.sqlstill droppedfield_table_id_idx, which deploy no longer creates (theUNIQUE (table_id, name)index covers it) —pgpm test-packages --full-cyclefailed the revert withindex "field_table_id_idx" does not exist.function-resolutioncatalog_moduleseed inserts enumerate every_table_idcolumn, and the four new ones areNOT NULL DEFAULT uuid_nil()with an FK tometaschema_public.table, so the default trippedcatalog_module_sites_web_config_table_fkeyon 30 tests.Verified locally:
pgpm test-packages --full-cyclepasses for all 28 modules (deploy → verify → revert), and every package with a jest suite passes, including the whole CI matrix.metaschema-modulessnapshots refreshed forpages_module;sql/<name>--<version>.sqland bundle artifacts regenerated for the changed modules only.Link to Devin session: https://app.devin.ai/sessions/001d2eec896340a09d5a2dd7ed898f0c
Requested by: @pyramation