surrealdb / surrealdb.js

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

Ensure PreparedQuery has replacer context #296

Closed kearfy closed 6 days ago

kearfy commented 6 days ago

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

What is the motivation?

In an oversight, PreparedQuery used just a bare minimal CBOR encoder, leaving custom tags such as record ids not properly encoded.

What does this change do?

Alters the partiallyEncodeObject method to accept all encode options, allowing the PreparedQuery class to pass a replacer to the CBOR encode method.

What is your testing strategy?

Added a test to ensure that prepared queries have replacer context.

Is this related to any issues?

No

Have you read the Contributing Guidelines?