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

Replace UPDATE with UPSERT #93

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

NCura
Copy link
Contributor

@NCura NCura commented Oct 23, 2024

Possible fix for issue 36.

This PR replaces the use of UPDATE with UPSERT. According to the SurrealQL documentation, UPSERT ensures that records are created if they don't already exist, addressing the issue where sessions were not being properly saved.

UPDATE on a single record in SurrealDB 1.x will create the record if it does not exist. This behaviour is no longer the case in SurrealDB 2.0. To update and create a record if it does not exist in SurrealDB 2.0, use the UPSERT statement.

Copy link
Member

@genusistimelord genusistimelord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you. Yeah I did not know they made that change.

@genusistimelord genusistimelord merged commit dfeba8f into AscendingCreations:main Oct 23, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants