-
Notifications
You must be signed in to change notification settings - Fork 181
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
Add docs on numeric data type #265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README.md
Outdated
|
||
**Note**: Please be advised the [node.js driver for postgres](https://github.com/brianc/node-postgres) by default casts `Numeric` type as a string on `GET` operation. This is to avoid _data precision loss_ since `Numeric` types in postgres cannot be safely converted to JavaScript `Number`. | ||
|
||
[Link to the corresponding driver issue](https://github.com/brianc/node-pg-types/issues/28). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe "For details, see the corresponding driver issue"?
README.md
Outdated
@@ -363,6 +363,12 @@ See [LoopBack types](http://loopback.io/doc/en/lb3/LoopBack-types.html) for de | |||
</tbody> | |||
</table> | |||
|
|||
## Numeric Data Type | |||
|
|||
**Note**: Please be advised the [node.js driver for postgres](https://github.com/brianc/node-postgres) by default casts `Numeric` type as a string on `GET` operation. This is to avoid _data precision loss_ since `Numeric` types in postgres cannot be safely converted to JavaScript `Number`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need the "please be advised".. but I'm not english expert :)
8408763
to
cdf51c3
Compare
Description
The node.js driver for postgres returns a
Numeric
type value as a string to avoid data precision loss. Since we as the ORM simply just return back the result from the driver, we need to document this behaviour.connect to #58