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

Converting BigInt to string in result type parsing #1676

Open
hicaro-bh opened this issue Jan 21, 2025 · 0 comments
Open

Converting BigInt to string in result type parsing #1676

hicaro-bh opened this issue Jan 21, 2025 · 0 comments
Labels
Q&A For non-issues. General Q&A

Comments

@hicaro-bh
Copy link

I noticed that when parsing BigInt values from MSSQL, Tedious converts them to strings even though the underlying readBigInt64LE returns a native JavaScript BigInt:

function readBigInt(buf: Buffer, offset: number): Result<string> {
  let value;
  ({ offset, value } = readBigInt64LE(buf, offset));

  return new Result(value.toString(), offset);
}

I'm curious about the reasoning behind this design decision. Is this related to:

  • JSON serialization compatibility?
  • Cross-environment support considerations?
  • Precision guarantees?
  • Framework compatibility?

Thanks for maintaining this library!

@hicaro-bh hicaro-bh added the Q&A For non-issues. General Q&A label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Q&A For non-issues. General Q&A
Projects
None yet
Development

No branches or pull requests

1 participant