surrealdb / surrealdb.js

SurrealDB SDK for JavaScript
https://surrealdb.com
Apache License 2.0
272 stars 45 forks source link

Allow bigint in record ids #250

Closed macjuul closed 2 months ago

macjuul commented 2 months ago

Thank you for submitting this pull request! We appreciate you spending the time to work on these changes.

What is the motivation?

cbor-redux can decode/encode bigint, however the zod union currently does not list bigint

What does this change do?

Adds bigint as valid record id value type

What is your testing strategy?

Added unit test

Is this related to any issues?

If this pull request is related to any other pull request or issue, or resolves any issues - then link all related pull requests and issues here.

Have you read the Contributing Guidelines?

rluvaton commented 3 weeks ago

FYI, you have a bug here as JSON.stringify does not support big int

See more: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json