vertica / vertica-nodejs

Official native node.js client for the Vertica Analytics Database.
https://www.vertica.com/
Apache License 2.0
12 stars 14 forks source link

Fix type parser overrides for connection pools #119

Closed DMickens closed 1 year ago

DMickens commented 1 year ago

Previously the overriding type parsers between pg and Vertica was done in the TypeOverrides function within type-overrides.js. This caused issues when multiple clients were in use. The pg enum value for Boolean is the same as the Vertica Numeric. When we overrode the type parser for Vertica Boolean with pg Boolean once, it worked fine. But then we overrode Vertica Numeric with pg no parser, or string. Because of this, every subsequent client, when trying to override Vertica Boolean with pg Boolean would actually be overriding Vertica Boolean with the no parser.

Now we prevent the issue by only overriding type parsers a single time outside of the TypeOverrides function