We are constantly improving the experience of using SurrealDB and in this release, we have been working on improving the schemafull experience.
Better schemafull experience
DEFINE statements now allow you to include an IF NOT EXISTS clause which ensures that the define statement is only run if the resource doesn't already exist. If it exists, you will get an error.
This brings us more in line with how things work in the SQL databases you might be familiar with.
We've also added an IF EXISTS clause to the REMOVE statement, which will only remove the resource if it exists.
This along with improving error messages and more consistent handling of negative numbers in record IDs, are just a few examples of the various ways we are taking your feedback and improving the developer experience.
Improved KNN syntax
In addition to improving the schemafull experience, we have also made improvements to the KNN Syntax, with the KNN operator now supporting a new syntax using <| and |> instead of < and >.
This helps differentiate it from our other features that also use the < and > syntax, such as type-casting.
Sometimes it's better to wait
The last thing to highlight here is that it's now possible to initialise a SurrealDB connection and run setup actions like authentication and selecting the database concurrently with other queries by making it possible to wait for the SDK to connect or select the database to use before allowing other queries to execute.
This is done with the new Surreal::wait_for syntax.
This would protect you against potential race conditions that you might have been susceptible to before:
But wait, there's more!
There are of course other great things we've included in this release, which we have not covered here. To see more examples and improvements check out our release notes, documentation and livestream.
