v1.2.0

Tue, 13 Feb 2024 00:00:00 GMT

Features: * Bump MSRV to 1.75. * In-memory index store. * Show execution time in CLI. * knn brute force. * Implement support for remote JSON Web Key Sets. * Add support for `LIVE SELECT` in the SDK and CLI. * Add `IF EXISTS` to `REMOVE TABLE` statement. * Add `READONLY` keyword to `DEFINE FIELD` statement. * Add alias `-V` and `--version` flags for `surreal version` command. * Define types for subfields when defining array fields. * Add `string::semver::compare`, `string::semver::major`, `string::semver::minor`, `string::semver::patch`, `string::semver::inc::major`, `string::semver::inc::minor`, `string::semver::inc::patch`, `string::semver::set::major`, `string::semver::set::minor`, `string::semver::set::patch` methods. Bug fixes: * Make record id string parsing never fail early. * Prevent overflow in `math::power()`. * Fix error message pointing to wrong character. * Respect alias for dynamic field queries with type::field. * Remove min/1000 in `tx:delp`. * Replace custom JWT parser causing decoding issues. * Issue with scoring on complex queries. * Limit recursion depth when parsing nested RELATE statements. * Fix a bug where a non-empty list parser would parse empty lists. * Ensure an attempt to set a protected variable returns an error. * Fix duration addition in timeout causing overflow. * Panic invoking parameters and functions without a database. * Fix a bug where the kind parser would eat whitespace. * Fix WebSocket notification sending format. * Implement missing errors for missing clauses on DEFINE-statements. * Ensure advanced `DEFINE PARAM` parameters are computed correctly. * Ensure path idioms are correct when looping over. * Fix json failing to parse with trailing whitespace. * Fix the five second delay in Wasm after initial connection. * Add context to live query notifications. * Fix the modulo operator on sql2 and parser1. * Improve the js-surql value conversion for numbers. * Implement revision types for client/server communication. * Fix builtin error pointing to the wrong part. * Fix a panic when invalid builtin function names are passed to the executor. Performance improvements: * Ensure compression is only enabled when response is a certain size. * In MTree large vector improvement. #### Use JWKS to dynamically configure your token definitions ```surql -- Specify the namespace and database for the token USE NS abcum DB app_vitalsense; -- Set the name of the token DEFINE TOKEN token_name -- Use this token provider for database authorization ON DATABASE -- Specify the JWKS specification used to verify the token TYPE JWKS -- Specify the URL where the JWKS object can be found VALUE "https://example.com/.well-known/jwks.json" ; ``` #### Define a `READONLY` field ```surql DEFINE FIELD created ON resource VALUE time::now() READONLY; ``` #### Define types for subfields when defining array fields ```surql DEFINE FIELD foo ON bar TYPE array -- Where is a subfield of the array type. -- It now defines the number subfield automatically instead of having to run this manually: DEFINE FIELD foo.* ON bar TYPE number ```