This is a very minimal reproduction code for the issue with enum arrays in pg-mem that occurs with Typeorm.
- clone repository
- run
npm i
- run
npm start
Enum arrays, like other arrays, are serialised as strings {value1, value2}
and pg-mem parses these strings into actual arrays ['value1', 'value2']
. The problem is that the ubiquitous Postgres driver namely node-postgres doesn't parse enum arrays by default (although it can be configured to do so). Thus, Typeorm always tries to parse enum arrays manually; which fails with pg-mem since they are already parsed beforehand.
At the very least, there should be an option to disable parsing of specified emums or enum arrays in general. Ideally the parsing corpus can be extracted into separate abstractions and be pluged-in as needed, similar to node-postgres.