Skip to content

feat: add DataDenormalized node type to registry#1277

Merged
pyramation merged 1 commit into
mainfrom
feat/data-denormalized-node-type
Jun 7, 2026
Merged

feat: add DataDenormalized node type to registry#1277
pyramation merged 1 commit into
mainfrom
feat/data-denormalized-node-type

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Registers DataDenormalized as a proper node type in node-type-registry. This was previously only available as a module config table (metaschema_modules_public.denormalized_table_field) with no registry entry — meaning it wasn't discoverable via the node type system or documented in skills.

DataDenormalized creates INSERT/UPDATE triggers that copy field values from a referenced parent table into the current table whenever the FK changes. Primary use case: denormalizing database_id onto junction tables so RLS policies can filter locally without joining through the parent.

// packages/node-type-registry/src/data/data-denormalized.ts
export const DataDenormalized: NodeTypeDefinition = {
  name: 'DataDenormalized',
  category: 'data',
  parameter_schema: {
    required: ['field', 'set_fields', 'ref_field', 'ref_fields'],
    properties: {
      field:          { format: 'column-ref' },  // FK on this table
      set_fields:     { items: { format: 'column-ref' } },  // fields to populate
      ref_field:      { format: 'column-ref' },  // FK target on parent
      ref_fields:     { items: { format: 'column-ref' } },  // fields to copy from parent
      use_updates:    { default: true },
      update_defaults:{ default: true },
      func_order:     { default: 0 },
    }
  }
};

Parameters mirror the existing metaschema_generators.denormalized_table_field() signature. Wiring into table_module() dispatch is a follow-up in constructive-db.

Link to Devin session: https://app.devin.ai/sessions/12842f98263d4815b6713291efc825ad
Requested by: @pyramation

Registers denormalized field triggers as a proper node type. Creates
INSERT/UPDATE triggers that copy field values from a referenced parent
table into the current table whenever the FK changes. Used to
denormalize frequently-read columns (e.g. database_id on junction
tables) so RLS and queries can filter locally without joining.
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation pyramation merged commit 24a7572 into main Jun 7, 2026
35 checks passed
@pyramation pyramation deleted the feat/data-denormalized-node-type branch June 7, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant