-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable pg parse bigint #3
Comments
I noticed the same issue. A large number of my columns are bigint, not only do their values in node show up as strings, but result set meta data also shows their 'format' as 'text' |
Since this is a blocking issue for me, the following experiment worked for me: ...
var types = {
FLOAT4: 700,
FLOAT8: 701,
NUMERIC: 1700,
BIGINT: 20,//<=
INT8: 20,//<=
FLOAT4_ARRAY: 1021,
FLOAT8_ARRAY: 1022,
NUMERIC_ARRAY: 1231
};
//just use the built-in V8 parseFloat implementation
pg.types.setTypeParser(types.FLOAT4, 'text', parseFloat);
pg.types.setTypeParser(types.FLOAT8, 'text', parseFloat);
pg.types.setTypeParser(types.NUMERIC, 'text', parseFloat);
pg.types.setTypeParser(types.BIGINT, 'text', parseFloat);//<=
pg.types.setTypeParser(types.INT8, 'text', parseFloat);//<=
... This isn't good enough for a pull request, since I probably didn't even need to add both, BIGINT and INT8. Hopefully this will be useful whoever gets stuck. |
Hi - sorry I missed the initial issue being opened up here. I'm totally down to add support for BIGINT as well. Do you want to submit a PR or do you want me to? As for the |
@brianc go for it. I modified my file locally and it works but didn't do any testing or even investigate enough to make sure the change is good enough to be committed. |
Can this be extended to support biginteger?
I have a few columns with BIGINT but they are all below 53 bits in length so I would like them to all be parsed as javascript integer. Can this module extend support?
The text was updated successfully, but these errors were encountered: