v0.17.0
[0.17.0] - 2023-09-19
-
Support environment variables substituion for SQL and system commands.
For compatibility, this feature is by default disabled, and can be enabled by addingcontrol substitution on
to the test file.control substitution on query TTTT SELECT '$foo' -- short , '${foo}' -- long , '${bar:default}' -- default value , '${bar:$foo-default}' -- recursive default value FROM baz; ---- ...
Besides, there's a special variable
$__TEST_DIR__
which is the path to a temporary directory specific to the current test case.
This can be helpful if you need to manipulate some external resources during the test.control substitution on statement ok COPY (SELECT * FROM foo) TO '$__TEST_DIR__/foo.txt'; system ok echo "foo" > "$__TEST_DIR__/foo.txt"
Changes:
- (parser) Breaking change: Add
Control::Substitution
. MarkControl
as#[non_exhaustive]
. - (runner) Breaking change: Remove
enable_testdir
. For migration, one should now enable general substitution by thecontrol
statement and use a dollar-prefixed$__TEST_DIR__
.
- (parser) Breaking change: Add