postgresql-client icon indicating copy to clipboard operation
postgresql-client copied to clipboard

Better typescript definitions + expose DatabaseError

Open jacobdr opened this issue 1 year ago • 1 comments

  • Export more precise typings for data types This enabled the following:

    Screenshot 2024-04-17 at 10 40 06 AM
  • Expose the database error so that users can use instanceof checks This enabled the following:

    Screenshot 2024-04-17 at 10 41 58 AM

jacobdr avatar Apr 17 '24 17:04 jacobdr

Hi Jacob,

  1. Exposing DatabaseError is ok.
  2. Setting DataTypeOIDs as const, i am not sure. We can not be sure that DataTypeOIDs is a complete list of all oids. So i think that it should allow adding items via augmentation. This is why we didn't use enum. Did you test that your code do not prevent augmentation?

erayhanoglu avatar Apr 20 '24 06:04 erayhanoglu

Sorry, i am closing this pull request because of no response to questions.

erayhanoglu avatar May 26 '24 20:05 erayhanoglu