Skip to content
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.

字段类型int8 #130

Open
JamesRen88 opened this issue Sep 12, 2019 · 1 comment
Open

字段类型int8 #130

JamesRen88 opened this issue Sep 12, 2019 · 1 comment

Comments

@JamesRen88
Copy link

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

@charmander
Copy link
Collaborator

charmander commented Sep 12, 2019

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);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants