Kanel is great! That's what I used before pg-typesafe, and I still use it for dynamic queries.

Regarding the nominal/branded types, the typegen is configurable, so instead of e.g. mapping oid 20 to a bigint, you could map the field id of table foo to Foo["id"] from kanel.

see this example https://github.com/n-e/pg-typesafe?tab=readme-ov-file#type-j...