字段类型int8
JamesRen88 opened this issue · comments
JamesRen88 commented
数据库设计字段类型为:int8,通过查询返回字段值是字符串类型了?why
Charmander commented
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);