3

Could you provide an example for node-pg-types with the "import" statement and not "require" so that type translators get registered for node-postgres?

Andris
  • 4,392
  • 2
  • 20
  • 16

2 Answers2

0

Currently it's not possible, because it's not being exported. The best you can do is.

import pg from 'pg'

const { types } = pg
xpuu
  • 1,514
  • 13
  • 13
0

As it turns out it can be done as (from github):

import { builtins, getTypeParser } from 'pg-types'
Andris
  • 4,392
  • 2
  • 20
  • 16