brianc / node-pg-types

Type parsing for node-postgres
267 stars 54 forks source link

overriding a type parser #136

Closed IbrahimGerbiqi closed 2 years ago

IbrahimGerbiqi commented 2 years ago

Can you help me about disabling type parser for date import { types } from 'pg'; types.setTypeParser(types.TypeId.TIME, (timeStr) => timeStr); types.setTypeParser(types.TypeId.TIMESTAMP, (timeStr) => timeStr); types.setTypeParser(types.TypeId.TIMESTAMPTZ, (timeStr) => timeStr);

i added those on main.ts but still same no progress.

where should i add these lines?

Nest.js TypeORM Postgres

bendrucker commented 2 years ago

You mention parsing dates but none of those types are dates in the PG sense. JS only has Date which is an a timestamp. PG has dates which are just the calendar date part in addition to full date/time stamps.

Issues are for problems with the library and not general programming help, hopefully that gets you started at least.