Author here, wanted to add some stuff that did not fit above. I came to this 20+ years ago as I was not satisfied with orthodox solutions to the tension of between normalization and the inherent need to generate derived values from the normalized ones. In 2002 I wrote a passable version in PHP and made my living with the approach until about 2009. Last year I reasoned if LLM's were truly capable, I could make a far more robust and capable version in Typescript. This is the result, after several iterations.
Open gitlab.comgitlab.com/kendowns/denorm
Denorm
Declarative derived columns and DSL for PostgreSQL.
Visit project- First shared
- Aug 4, 2026
- HN activity
- 21
Show HN@KenPainterAug 4, 2026
Show HN: Denorm – Declarative derived columns (Postgres)
Denorm solves my own long-standing pain points with biz logic and the DB, providing a declarative DSL in which derived columns are part of the schema. Data moves along foreign keys: down from parent to child, aggregate from child to parent, and of course within rows. Can also generate parents and children along the foreign key. The README example: table us_states column state_code char(2) primary key column state_name varchar(20) column children_count integer count child_table table child_table column child_id serial primary key fk us_states references us_states pushes child_table column state_code is us_states.state_code column state_name sync us_states.state_name Denorm colocation of external values with derived values offers very high compression of logic definitions. It's a pay me now trade. The write is more expensive in exchange for simpler modeling, simpler reads and writes, simpler stack. The builder traps cycles, so we get termination. Builds are idempotent and additive, any-state to current. Ranged foreign keys are first class citizens (not just time series). Derived values are not subvertible. Race conditions and deadlocks eliminated (*except generating children can produce deadlocks the client must handle). If you already have Postgres installed, you can get something usable in 10-20 minutes following the README.
Community