Skip to content

Latest commit

 

History

History
10 lines (10 loc) · 1.07 KB

README.md

File metadata and controls

10 lines (10 loc) · 1.07 KB

What is this?

This is a very minimal reproduction code for the issue with enum arrays in pg-mem that occurs with Typeorm.

How to run it?

  1. clone repository
  2. run npm i
  3. run npm start

Why the issue occurs?

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.

What can be done about this?

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.