Error: tables can have at most 1600 columns


What would cause an error like this when trying to provision? I only have one persistable type in my data model, and it doesn’t have an unreasonable amount of fields. Where should I start looking?



My current working theory is that I have a lot of non-persisted types that chain between fields, eventually ending up at a type with a [double] field that requires a schema suffix. Is it possible that it’s creating postgres columns for every permutation of these chains of fields? Would it help to make an intermediate type persisted to break this into multiple tables?



This ended up being the case…
To avoid this, you can:

entity type TypeA schema name 'TYPA' {
    field1: anyof(TypeB)

This is definitely a workaround, and not to be considered best practice, but will keep all subsequent fields under one column.