-
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
Update BigInteger and BigSerial TsTypes #106
Conversation
src/types/big-integer.ts
Outdated
@@ -26,7 +26,7 @@ export const fetchProcessing: TypeUtils.FetchProcessing<Types['Read']> = ( | |||
} else { | |||
throw new Error('Fetched bigint is not valid: ' + typeof data); | |||
} | |||
return value; | |||
return value.toString(); |
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'd rather only do the toString()
when it's necessary and avoid unnecessary conversions to BigInt
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.
Updated
@@ -24,7 +24,7 @@ export const types = { | |||
}, | |||
}; | |||
|
|||
export type Types = TypeUtils.TsTypes<bigint, number | bigint>; | |||
export type Types = TypeUtils.TsTypes<string, string | number | bigint>; |
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.
Does this file not need a fetchProcessing
? I would expect it to be essentially identical to big-integer
outside of the db type including the auto incrementing stuff
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.
If you notice at the top of the file I'm exporting the fetchProcessing
from big-integer
for the reason you mentioned of them essentially being identical. Is there something we should be doing specifically for the auto incrementing? I checked serial
for an example, but it doesn't have a fetchProcessing
to reference.
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 just didn't see the export is all, I assumed it was just imports that were necessary and skipped over it
Return big integer values as strings instead of bigint as we need to parse them back into strings anyway when returning data from pine. The new logic and types closely follow the same pattern we have for dates. Change-type: major
127ae31
to
45d3cd6
Compare
Return big integer values as strings instead of bigint as we need to parse them back into strings anyway when returning data from pine. The new logic and types closely follow the same pattern we have for dates.
Change-type: major