test: add 17 tests, fix double-sort bug, update docs and CI#4
Merged
Conversation
Cover previously untested error paths: - Persistence: VersionMismatchError, invalid JSON, write to unwritable path - Parser: SyntaxError_ for malformed SQL, unterminated strings, unexpected chars, empty SQL - Database: query() on non-SELECT, INSERT/UPDATE/DELETE/SELECT on nonexistent table, DROP TABLE via SQL, __repr__, NULL on primary key, missing nullable columns, DuplicateKeyError message content Increases test count from 78 to 95. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
…evel Remove hardcoded sys.path.insert(0, '/home/sebtardif/MiniDB') from all test files and main.py. This path points to a non-existent Linux directory and is unnecessary since pytest discovers packages via pyproject.toml. Move 'import re' from inside _match_like() to query.py module level. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
- Update test count from 29+ to 95+ - Replace placeholder clone URL with actual GitHub URL - Document LEFT JOIN support in Features, SQL Reference, and Limitations - Add Python 3.14 classifier to pyproject.toml - Update test_queries.py description to include parser/type tests Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
- Add Python 3.14 to CI test matrix (already tested locally, classifier added in prior commit) - Add .mypy_cache/ to .gitignore to prevent accidental tracking Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
When ORDER BY direction was DESC, _execute_order_by sorted the rows ascending first, then re-sorted descending. This doubled the sort work for every DESC query. Fixed by computing the reverse flag once and passing it to a single sorted() call. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
New contributors can now find the complete development workflow: prerequisites, dev tool installation, pre-commit checks matching CI, conventional commit format, and project structure overview. README.md now links to CONTRIBUTING.md. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multi-perspective improvement cycle across 14 engineering perspectives. Addresses test gaps, a correctness bug, stale documentation, and CI improvements.
Changes
Tests (17 new)
Bug fix
_execute_order_bywas sorting ascending then re-sorting descending, producing correct results by coincidence but doing redundant work. Fixed to compute direction once.Refactoring
sys.path.insert(0, '/home/sebtardif/MiniDB')from 8 test files and main.pyimport refrom inside_match_like()to module level in query.pyDocumentation
CI
.mypy_cache/to .gitignoreVerification