Tests are DuckDB SQLLogicTests under test/sql/.
GEN=ninja make
build/release/test/unittestbuild/release/test/unittest "test/sql/select.test"
build/release/test/unittest "test/sql/tpch.test"Every feature test needs a round-trip check:
query I
PRAGMA lpts_check('SELECT name FROM users WHERE age > 25');
----
trueUse PRAGMA lpts_exec('<query>') only when concrete output rows are useful.
Use lpts_query('<query>') only when the exact generated SQL is the behavior
under test.
Before marking a feature done, test it with real queries in the DuckDB shell:
INSTALL lpts FROM community;
LOAD lpts;
CREATE TABLE users (id INTEGER, name VARCHAR, age INTEGER);
INSERT INTO users VALUES (1, 'Alice', 30), (2, 'Bob', 22);
PRAGMA lpts('SELECT name FROM users WHERE age > 25');
PRAGMA lpts_exec('SELECT name FROM users WHERE age > 25');
PRAGMA lpts_check('SELECT name FROM users WHERE age > 25');- Prefer small tables and focused queries.
- Use
rowsortwhen row order is not part of the behavior. - Use explicit
ORDER BYwhen order is part of the behavior. - Do not remove a failing test to make the suite pass.