All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Allow multiple connections to the database in a single test case, which is useful for testing the transaction behavior. This can be achieved by attaching a
connection foo
record before the query or statement.- (parser) Add
Record::Connection
. - (runner) Breaking change: Since the runner may establish multiple connections at runtime,
Runner::new
now takes aimpl MakeConnection
, which is usually a closure that returns a try-future of theAsyncDB
instance. - (bin) The connection to the database is now established lazily on the first query or statement.
- (parser) Add
- We enhanced how
skipif
andonlyif
works. Previously it checks againstDB::engine_name()
, andsqllogictest-bin
didn't implement it.- (parser) A minor breaking change: Change the field names of
Condition:: OnlyIf/SkipIf
. - (runner) Add
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 theskipif/onlyif <lable>
. - (bin) Add
--label
option to specify custom labels.
- (parser) A minor breaking change: Change the field names of
Runner::update_test_file
properly escapes regex special characters.
- Support postgres options.
sqllogictest-bin
now uses the strict validator to update records (the runner still doesn't check schema).- The query syntax now allows optional columns (
query\n
without any column arguments).
- customizable column types and validators
- support multiple files as input in cli
- remove unnecessary debug
- fix parsing for trailing comments
This release contains some minor fixes.
- fix: use
Vec<Vec<String>>
for external engine (JDBC) - fix: Use
lines()
instead ofsplit('\n')
inparse_inner
. So the behavior can be correct on Windows. - fix: parse DML with
returning
as a query - A minor breaking change:
update_test_file
takes&mut Runner
instead of its ownnership.
-
Improve the ability to unparse and update the test files. Mainly add
update_record_with_output
andupdate_test_file
to the library.More details:
- Add
impl Display
forRecord
(refactorunparse
). - Add
Record::Whitespace
so the whitespace in the original files can be reconstructed duringunparse
. - Add tests for unparsing and updating records.
- Refactor and fix the behavior about newlines and
halt
for CLI options--override
and--format
.
- Add
-
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 fromfn(&Vec<String>, &Vec<String>) -> bool
tofn(&[Vec<String>], &[String]) -> bool
. Also added adefault_validator
.
Thanks to the contributions of @alamb and @xudong963 .
- Improve the format and color handling for errors.
- Support
hash-threshold
. - Fix
statement count <n>
for postgres engines. - Breaking change: use
Vec<Vec<String>>
instead ofString
as the query results byDB
. This allows the runner to verify the results more precisely.- For
rowsort
, runner will only sort actual results now, which means the result in the test cases should be sorted.
- For
- Breaking change:
Hook
is removed. - Breaking change:
Record
and parser's behavior are tweaked:- retain
Include
record when linking its content - keep parsing after
Halt
- move
Begin/EndInclude
toInjected
- retain
- Added CLI options
--override
and--format
, which can override the test files with the actual output of the database, or reformat the test files.
- Support checking error message using
statement error <regex>
andquery error <regex>
syntax.- Breaking change:
Record::Statement
,Record::Query
andTestErrorKind
are changed accordingly.
- Breaking change:
- Fix:
--external-engine-command-template
should not be required
- Add support for external driver.
- Support more type in postgres-extended.
- Record file stack in location.
- Use one session for each file in serial mode.
- Support registering hook function after each query.
- Support load balancing of multiple addr.
- Integrate with libtest-mimic. Add the macro
sqllogictest::harness!
. - Improve error handling for parser.
- Add parallel running to
Runner
. - Drop database after parallel run.
- Support postgres extended mode
- Separate sqllogictest runner to sqllogictest-bin
- Add timestamp to junit. (#57)
- Add
sleep
function toAsyncDB
. (#61) - Fix panic without junit. (#58)
- Remove unsupported characters from junit test name.
- Add junit support. Use
--junit <filename>
to generate junit xml.
- Fix expanded
include
wildcard file name. (#52)
- Support wildcard in
include
statement. (#49)
- Show diff instead of actual / expected data on failed. (#51)
- Print empty strings as "(empty)"
- Support parallel sqllogictest
- Panic if no test file is found
- New test UI for sqllogictest binary
- Support set console color on the test UI with
--color
parameter
- Async interface
AsyncDB
for SQL runners. - support evaluating
skipif
andonlyif
conditions - support file-level sort mode control syntax
- supports custom validator
- A command-line tool to run scripts from file against postgres-compatible databases.
- Support
sleep
andinclude
statement.
- Add file location to the error message.
- Runner returns error type instead of panic.
- Basic sqllogictest parser and runner.