NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #2755 most downloaded on crates.io
Sqllogictest parser and runner.
Last release 7 months ago
14 Feb 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
5 years old
71 releases · first in 2021
One column per quarter.
parser/runner: Add let record for binding query results to variables.
let record for binding query results to variables.parser/runner: Support matching expected failures by SQLSTATE via statement|query error (<SQLSTATE>) .
statement|query error (<SQLSTATE>).bin: support skip files with regex
<slt:ignore> to skip the volatile parts of the output.<slt:ignore> to skip the volatile parts of the output.bin: Add --shutdown-timeout to set a timeout for shutting down the database connections after a test file is finished. By default, this is unspecified
--shutdown-timeout to set a timeout for shutting down the database connections after a test file is finished. By default, this is unspecified, meaning to wait forever.engines: Enhance graceful shutdown by canceling ongoing queries when shutting down postgres connections. This improves the behavior when receiving a C
Ctrl-C signal by ensuring that any long-running queries are properly canceled before the connection is closed.bin: Support graceful shutdown. When receiving a Ctrl-C , the program will cancel all running test cases, log cancelled and skipped test cases, drop t
Ctrl-C, the program will cancel all running test cases, log cancelled and skipped test cases, drop temporary databases (if in parallel mode), close database connections, and finally exit with a non-zero code.runner: Add Partitioner and Runner::with_partitioner to enable partitioning of test cases, allowing only a subset of the glob result to be executed. T
Partitioner and Runner::with_partitioner to enable partitioning of test cases, allowing only a subset of the glob result to be executed. This can be helpful for running tests in parallel in CI.--partition-id and --partition-count to set a hash partitioning for the test cases. If users are running in Buildkite CI with parallelism: .. specified in the workflow file, this will be automatically configured.engines/bin: fix stdin to be closed properly to avoid hangs in the external engine.
external engine.runner: Add Runner::set_var method to allow adding runner-local variables for substitution.
Runner::set_var method to allow adding runner-local variables for substitution.__DATABASE__ variable for accessing current database name from SLT files.runner: add shutdown method to DB and AsyncDB trait to allow for graceful shutdown of the database connection. Users are encouraged to call Runner::sh
shutdown method to DB and AsyncDB trait to allow for graceful shutdown of the database connection. Users are encouraged to call Runner::shutdown or Runner::shutdown_async after running tests to ensure that the database connections are properly closed.runner: add random string in path generation to avoid conflict when using include.
include.bin: when --fail-fast is enabled, abort all remaining connections before dropping temporary databases.
--fail-fast is enabled, abort all remaining connections before dropping temporary databases.bin: support --fail-fast, and add env vars SLT_FAIL_FAST and SLT_KEEP_DB_ON_FAILURE
--fail-fast, and add env vars SLT_FAIL_FAST and SLT_KEEP_DB_ON_FAILUREparser/runner: support system ok retry
system ok retryparser: Add back label support, which was removed in 0.25.0.
label support, which was removed in 0.25.0.[statement|query] error retry (Only support multi-line error message)runner: Add retry clause to statement ok and query ok|error.
retry clause to statement ok and query ok|error.runner: Added a Normalizer type for normalizing result values. A new function with_normalizer(normalizer: Normalizer) has been added to the Runner to
Normalizer type for normalizing result values. A new function
with_normalizer(normalizer: Normalizer)
has been added to the Runner to allow for specifying a custom Normalizer. The existing default normalizer
is available via the runner::default_normalizer(..) function.resultmode that controls whether the results are in
valuewise or columnwise mode. The default is columnwise which means results are in columns.
valuewise means the results are in a single column (sqlite test style).valuesortsort mode. The valuesort mode works like rowsort except that it does not
honor row groupings. Each individual result value is sorted on its own.Breaking change:
Validator type used in various function in Runner implementation has a new required field Normalizer
that is used to normalize result values.feat(bin): add opt --keep-db-on-failure
--keep-db-on-failureRefine the behavior of update_record_with_output / --override
update_record_with_output / --override
query returning 0 rows will become statement ok. Now it returns statement count 0.--override will not change the type chars of query <types>, since in practice
it becomes ?s which might cause confusion.statement count <n> is incorrectly handled when the result is a query.engines/bin: support MySQL engine
runner: RecordOutput is now returned by Runner::run (or Runner::run_async). This allows users to access the output of each record, or check whether th
Breaking changes:
RecordOutput is now returned by Runner::run (or Runner::run_async). This allows users to access the
output of each record, or check whether the record is skipped.__NOW__ which will be replaced with the current Unix timestamp in
nanoseconds.system commands, we do not substitute environment variables any more, because the shell
can do that. It's necessary to escape like \\ any more. $__TEST_DIR__, and are still supported.sh to bash.runner: add logs for system command (with target sqllogictest::system_command) for ease of debugging.
system command (with target sqllogictest::system_command) for ease of debugging.fix(runner): when running in parallel, the runner will correctly inherit configuration like sort_mode and labels from the main runner.
sort_mode and labels
from the main runner.* bump dependencies
feat(bin): hide INFO level log by default
INFO level log by default* fix(bin): halt is not handled.
halt is not handled.bin: When using -j to run tests in parallel, add a random suffix to the temporary databases. This is useful if the test is manually canceled, but you
-j <jobs> to run tests in parallel, add a random suffix to the temporary databases. This is useful
if the test is manually canceled, but you want to rerun it freshly. Note that if the test failed, the database will be
dropped. This is existing behavior and unchanged.env_logger with tracing-subscriber. You will be able to see the record being executed with
RUST_LOG=debug sqllogictest ....system commands (end with &). In 0.20.0, it will block until the process
exits. Now we return immediately.system ok
sleep 5 &
Show stdout, stderr when system command fails.
Show stdout, stderr when system command fails.
Support matching stdout for system
system ok
echo "Hello, world!"
----
Hello, world!
Currently, only exact match is supported. Besides, the output cannot contain more than one blank lines in between. The record ends with two consecutive blank lines.
Some minor Breaking changes:
stdout to parser::Record::System and runner::RecordOutput::System, and mark them as
#[non_exhaustive].AsyncDB::run_command's return type from std::process::ExitStatus to
std::process::Output.parser: include now returns error if no file is matched.
include now returns error if no file is matched.parser: refactor expect field in sqllogictest parser to make it easier to work with.
expect field in sqllogictest parser to make it easier to work with.Breaking changes in the parser:
Support matching multiline error message under ---- for both statement error and query error.
query error
SELECT 1/0;
----
db error: ERROR: Failed to execute query
Caused by these errors:
1: Failed to evaluate expression: 1/0
2: Division by zero
The output error message must be the exact match of the expected one to pass the test, except for the leading and
trailing whitespaces. Users may use --override to let the runner update the test files with the actual output.
Empty lines are allowed in the expected error message. As a result, the message must end with two consecutive empty lines.
Breaking changes in the parser:
ParseErrorKind. Mark it as #[non_exhaustive].expected_error from Regex to ExpectedError, which is either a inline Regex or multiline
String.fix(runner): fix parallel testing db name duplication. Now we use full file path instead of filename as the temporary db name in run_parallel_async.
run_parallel_async.bin: support envvars SLT_HOST/PORT/DB/USER/PASSWORD
SLT_HOST/PORT/DB/USER/PASSWORD(parser) Breaking change: Add Control::Substitution. Mark Control as #[non_exhaustive].
Support environment variables substitution for SQL and system commands.
For compatibility, this feature is by default disabled, and can be enabled by adding control 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:
Control::Substitution. Mark Control as #[non_exhaustive].enable_testdir. For migration, one should now enable general substitution
by the control statement and use a dollar-prefixed $__TEST_DIR__.(parser) Breaking change: Add Record::System, and corresponding TestErrorKind and RecordOutput. Mark TestErrorKind and RecordOutput as #[non_exhaustiv…
Support running external system commands with the syntax below. This is useful for manipulating some external resources during the test.
system ok
echo "Hello, world!"
The runner will check the exit code of the command, and the output will be ignored. Currently, only ok is supported.
Changes:
Record::System, and corresponding TestErrorKind and RecordOutput. Mark
TestErrorKind and RecordOutput as #[non_exhaustive].run_command to AsyncDB trait. The default implementation will run the command with
std::process::Command::status. Implementors can override this method to utilize an asynchronous runtime such as
tokio.fix(runner): fix database name duplication for parallel tests by using the full path of the test file (instead of the file name) as the database name.
fix(bin): fix error context display. To avoid stack backtrace being printed, unset RUST_BACKTRACE environment variable, or use pre-built binaries buil
RUST_BACKTRACE environment
variable, or use pre-built binaries built with stable toolchain instead.fix(bin): do not print stack backtrace on error
fix statement error unexpectedly passed when result is a successful query. Similarly for expected query error but successful statement ok.
statement error unexpectedly passed when result is a successful query. Similarly for expected query error
but successful statement ok.(runner) Breaking change: Since the runner may establish multiple connections at runtime, Runner::new now takes a impl MakeConnection, which is usuall…
connection foo record before the query or statement.
Record::Connection.Runner::new now
takes a impl MakeConnection, which is usually a closure that returns a try-future of the AsyncDB instance.(parser) A minor breaking change: Change the field names of Condition:: OnlyIf/SkipIf.
skipif and onlyif works. Previously it checks against DB::engine_name(), and sqllogictest-bin
didn't implement it.
Condition:: OnlyIf/SkipIf.Runner::add_label. Now multiple labels are supported ( DB::engine_name() is still included). The
condition evaluates to true if any of the provided labels match the skipif/onlyif <label>.--label option to specify custom labels.Runner::update_test_file properly escapes regex special characters.
Runner::update_test_file properly escapes regex special characters.sqllogictest-bin now uses the strict validator to update records (the runner still doesn't check schema).
sqllogictest-bin now uses the strict validator to update records (the runner still doesn't check schema).query\n without any column arguments).Nothing published for this version
customizable column types and validators
support multiple files as input in cli
fix parsing for trailing comments
A minor breaking change: update_test_file takes &mut Runner instead of its ownnership.
This release contains some minor fixes.
Vec<Vec<String>> for external engine (JDBC)lines() instead of split('\n') in parse_inner. So the behavior can be correct on Windows.returning as a queryupdate_test_file takes &mut Runner instead of its ownnership.Breaking change: The type of Validator is changed from fn(&Vec , &Vec ) -> bool to fn(&[Vec ], &[String]) -> bool. Also added a default_validator.
Improve the ability to unparse and update the test files. Mainly add update_record_with_output and
update_test_file to the library.
More details:
impl Display for Record (refactor unparse).Record::Whitespace so the whitespace in the original files can be reconstructed during unparse.halt for CLI options --override and --format.Fix: hash-threshold should be compared with the number of values instead of the number of rows.
Breaking change: The type of Validator is changed from fn(&Vec<String>, &Vec<String>) -> bool to
fn(&[Vec<String>], &[String]) -> bool. Also added a default_validator.
Thanks to the contributions of @alamb and @xudong963 .
Breaking change: use Vec > instead of String as the query results by DB. This allows the runner to verify the results more precisely.
hash-threshold.statement count <n> for postgres engines.Vec<Vec<String>> instead of String as the query results by DB. This allows the runner
to verify the results more precisely.
rowsort, runner will only sort actual results now, which means the result in the test cases should be
sorted.Hook is removed.Record and parser's behavior are tweaked:
Include record when linking its contentHaltBegin/EndInclude to Injected--override and --format, which can override the test files with the actual output of the
database, or reformat the test files.Breaking change: Record::Statement, Record::Query and TestErrorKind are changed accordingly.
statement error <regex> and query error <regex> syntax.
Record::Statement, Record::Query and TestErrorKind are changed accordingly.Fix: --external-engine-command-template should not be required
--external-engine-command-template should not be requiredAdd support for external driver.
Use one session for each file in serial mode.
Support registering hook function after each query.
Support load balancing of multiple addr.
sqllogictest::harness!.Add parallel running to Runner.
Runner.Separate sqllogictest runner to sqllogictest-bin
- Add timestamp to junit. (#57) - Add sleep function to AsyncDB. (#61) - Fix panic without junit.
sleep function to AsyncDB. (#61)Remove unsupported characters from junit test name.
Add junit support. Use --junit to generate junit xml.
--junit <filename> to generate junit xml.Your coding agent can read these notes before it upgrades. Set up the MCP server →