Skip to content
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

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

joshbwlng
Copy link
Contributor

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

@joshbwlng joshbwlng self-assigned this Jun 25, 2024
@joshbwlng joshbwlng requested a review from Page- June 25, 2024 00:39
@flowzone-app flowzone-app bot enabled auto-merge June 25, 2024 00:42
@@ -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();
Copy link
Collaborator

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

Copy link
Contributor Author

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>;
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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
@flowzone-app flowzone-app bot merged commit ab5ed18 into master Jul 19, 2024
52 checks passed
@flowzone-app flowzone-app bot deleted the joshbwlng/bigint-string branch July 19, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants