v1.1.0
Minor version adding more json builtins and an improved built-in system.
This change adds some json builtins and also completely refactors the built-in
system to make it more efficient. It also adds some quality of life improvements
to the C++ API. The C API remains stable, but the C++ API exposes additional
methods to make handling outputs of queries a bit easier.
New Features
json.filter,json.patch, andjson.removeare now available- All built-ins are now accounted for in the built-in system, and those which
are not supported are explicitly marked as such. - There is now an
Outputclass, which is returned from the newquery_output
method onInterpreter. It provides methods which are similar to those available
in the C API for inspecting the output of a query. - There are now
try_get_double,try_get_string, andtry_get_boolmethods
which will attempt to get raw C++ types from Node objects. - The
whitelistandblacklistmethods inBuiltInsDefprovide fine-grained
control over which built-ins are allowed to be loaded. - The
stmt_limitmethod onInterpreterprovides a time-out mechanism (defined
as number of statements which the VM is allowed to execute)
Improvements
- The
Interpreterobject can now be created at almost no cost. A large portion
of its construction cost was the creation of theBuiltInslookup structure,
which now is defined statically in-code. - The test driver can now run all the tests in the OPA test suite and will skip
those which use a built-in that is not available in the current implementation.
This means we do not have to cherry-pick tests anymore, and will pick up
new tests more cleanly. - New methods for creating scalar nodes have been added (
number,boolean,
string,null) and the existingscalarmethods have been deprecated.
Breaking Changes
- The
get_stringmethod, which previously returned the raw string of the Trieste
node, now tries to get a string from aJSONStringnode and strips it of its
quotes (in line with the otherget_*methods). The previous functionality is
available viaget_raw_string.
Bug Fixes
- Fuzzer bug with
SomeDeclin aNotExpr - An issue with built-ins not being written to binary bundles
- A unification bug with variables in comprehensions that had the same name as their module
regopynow performs some additional checks to ensure it is loading the correct
shared library on all platforms- Ubuntu 22.04 builds are now working again and the image has been added back to the workflow
- macos/x86_64 image has been added back to the workflow, and shared library builds
(for the Python and dotnet wrappers) - Unification bug with masking scopes and variables with comprehensions and every