brianc / node-pg-pool

A connection pool for node-postgres

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

字段类型int8

JamesRen88 opened this issue · comments

数据库设计字段类型为:int8,通过查询返回字段值是字符串类型了?why

pg was created before a JavaScript primitive that could represent 64-bit integers precisely existed, but you can change the parser to produce a BigInt nowadays:

const types = require('pg').types;

const INT8_OID = 20;

types.setTypeParser(INT8_OID, BigInt);