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

Feature: RecordId class should error if passing a RecordId as parameter #242

Open
2 tasks done
vitorTheDev opened this issue Apr 21, 2024 · 0 comments
Open
2 tasks done

Comments

@vitorTheDev
Copy link

vitorTheDev commented Apr 21, 2024

Is your feature request related to a problem?

When upgranding from surreal.js 0.x.x to 1.x.x, it's common to cast string parameters as RecordId class. However, some of those values already come as a RecordId, causing mistakes in casting the recordId twice e.g.

new RecordId('table', new RecordId('table', 'id'))

This, instead of proper errors, causes weird behavior in surrealdb.

Describe the solution

The class creation should fail if the id or table parameters are instanceof RecordId with a proper error.

Alternative methods

OR maybe it should parse it correctly.

SurrealDB version

1.4.2 for windows on x86_64

SurrealDB.js version

1.0.0-beta.4

Contact Details

netd777@gmail.com

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

No branches or pull requests

1 participant