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

Documentation: Disambiguate SDK methods #367

Open
2 tasks done
knackstedt opened this issue Nov 11, 2024 · 0 comments
Open
2 tasks done

Documentation: Disambiguate SDK methods #367

knackstedt opened this issue Nov 11, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@knackstedt
Copy link
Contributor

Description

There is insufficient explanation where a developer should use create versus insert or live versus subscribeLive. Please add a paragraph that disambiguates when and why a developer should pick one over the other in the documentation -- as it stands now it's unclear when a developer should pick one over the other. It's somewhat more clear for subscribeLive but it's still decently blurry to the unfamiliar developer -- adding a "use case" section would make it more clear where and when to use it.

Notably, there are differences in functionality where db.insert throws an error if provided a RecordId object, and db.create handles that with no error.

https://surrealdb.com/docs/sdk/javascript/methods/create
https://surrealdb.com/docs/sdk/javascript/methods/insert
https://surrealdb.com/docs/sdk/javascript/methods/live
https://surrealdb.com/docs/sdk/javascript/methods/subscribelive

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
@knackstedt knackstedt added the documentation Improvements or additions to documentation label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant