v0.3.0

Tue, 14 Dec 2021 00:00:00 GMT

Features:

* Enable query and session parameters to be defined on a JSON-RPC connection
* Ensure subqueries can access encoding parent query and grand-parent queries
* Add diff-match-patch functionality when updating document records
* Separate authentication levels for Namespace and Database specific access
* Authentication scope definition and setup, with user-defined authentication logic for each scope

#### Pre-defined aggregate analytics views

Aggregate views let you pre-compute analytics queries as data is written to SurrealDB. Similarly to an index, a table view lets you select, aggregate, group, and order data, with support for moving averages, time-based windowing, and attribute-based counting. Pre-defined aggregate views are efficient and performant, with only a single record modification being made for every write.

```surql
-- Drop all writes to the reading table. We don't need every reading.
DEFINE TABLE reading DROP;

-- Define a table as a view which aggregates data from the reading table
DEFINE TABLE temperatures_by_month AS
SELECT
count() AS total,
time::month(recorded_at) AS month,
math::mean(temperature) AS average_temp
FROM reading
GROUP BY city
;

-- Add a new temperature reading with some basic attributes
CREATE reading SET
temperature = 27.4,
recorded_at = time::now(),
city = 'London',
location = (-0.118092, 51.509865)
;
```