-
Notifications
You must be signed in to change notification settings - Fork 284
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
JsBigInt support? #376
Comments
There isn't a way to do this just yet. For the time being you can return a string like we are doing in the fibonacci example. There is a way to do this in neon. You can construct those objects in neon. I can't provide any examples just yet because I haven't done this myself yet. I will look into this soon |
Thanks. I figured I could just return a string and then handle it in JS if needed. I was just curious because I've been doing stuff with BigInts lately, but having it in neon isn't a need I have yet, though I imagine if I get into neon seriously I'll end up use them one way or another. |
What you can do is access the object from the global property with https://neon-bindings.com/api/neon/context/trait.context#method.global |
This could also be done with a buffer. I agree that this would be a great addition to neon. https://nodejs.org/api/buffer.html#buffer_buf_writebigint64be_value_offset |
Total newbie to neon, just kicking the tires.
I'm just curious if there's a way to return a JS BigInt. I just guessed at
JsResult<JsBigInt>
, but that was wrong.I believe there are three distinct BigInt types:
BigInt
)BigInt64Array.from([-123n])
)BigInt64Array.from([123n])
)The later two are
i64
andu64
and the first is true arbitrary precision.The text was updated successfully, but these errors were encountered: