v0.7.3-beta1
Pre-release
Pre-release
This release contains the accumulation of various small improvements and fixes.
Notable improvements:
- The addition of the function
slice_string(s, start, end)
, which makes working with strings easier. Counting is done with unicode codepoints (same as python, but not the same as JS which uses UTF-16). - In imperative scripts, you can use
%return _rel1, rel2, ...
to return multiple relations. However, client support is not available yet. - Functions
starts_with
andends_with
now work with bytes. - In imperative scripts, you can use
{ ... } as _relname
to make an ephemeral relation. This saves quite a lot of typing. - You can now use base64 strings when putting into a field of Vec. The base64 must decode into bytes that can be interpreted as a C-array of little-endian float32/float64, according to the definition of the Vec.
- Except when using
:create
or:replace
, whether you write=>
in the field list of mutations is immaterial. - Parameters: the
$var
syntax in script denotes named parameters. These should be passed in together with the script when calling the database. - When doing mutations on stored relations, you can omit the fields if they are exactly the same as the program entry, i.e.
?[x, y, z] := ... :put rel {}
is equivalent to?[x, y, z] := ... :put {x, y, z}
- When using constant relation and only a single row is present, the program entry can be deduced, i.e.
?[] <- [[$x, $y, $z]]
is equivalent to?[x, y, z] <- [[$x, $y, $z]]
. This works together with the last item to allow writing?[] <- [[$x, $y, $z]] :put rel {}
- A new set of mutation operators in addition to
:put
and:rm
: these are:insert
,:update
, and:delete
, and these checks for the existence of rows already in the database with the same semantics as in SQL. When doing:update
s, you only need to specify the keys and the fields you want to update. - Mutations now support a
:returning
option which, if present, will return the changes applied by the mutation instead of the status code. - Most sysops such as
::index create
can be used in imperative scripts now. - The standalone server now supports a token relation: https://github.com/cozodb/cozo/blob/cd840e687c5bde9dc3c95968f07bbed1b3669a65/cozo-bin/src/server.rs#L65-L67. Contents in this relation can be used as bearer tokens to access the API remotely.