8000 Releases · mhbxyz/dictdb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Releases: mhbxyz/dictdb

v1.2.0

31 Mar 09:15
Compare
Choose a tag to compare

v1.2.0 (2025-03-31)

Features

  • benchmarking: Add benchmark script for query performance with and without indexes (137cee1)

  • Introduce scripts/benchmark.py which benchmarks DictDB's query performance using cProfile.

  • Implements three benchmarking scenarios: without an index, with a hash index and with a sorted index.

  • Populates a large dataset and measures the average execution time of a simple equality select query.

  • Module is fully documented in reStructuredText format and adheres to PEP8 with strong typing.

  • indexing: Add support for user-defined indexes and automatic index updates (d7c9baa)

  • Implement create_index() in Table to allow creating indexes on specific fields.

  • Automatically update indexes on INSERT, UPDATE, and DELETE operations.

  • Accelerate SELECT queries by using indexes for simple equality conditions.

  • Update documentation and inline comments to reflect new indexing feature and changes.

This commit introduces indexing functionality to optimize SELECT queries.

  • indexing: Use efficient index data structures for maintaining indices (d0604a3)

  • Introduced a new module "index.py" defining an abstract IndexBase with two implementations: HashIndex (using Python's dict, a hash map) and SortedIndex (a simple sorted index using bisect to simulate B-tree behavior).

  • Updated Table.create_index() to accept an "index_type" parameter ("hash" or "sorted") and instantiate the corresponding index.

  • Refactored _update_indexes_on_insert, _update_indexes_on_update, and _update_indexes_on_delete in Table to delegate to the index object's methods.

  • Modified select() to use index.search() for simple equality conditions.

  • Added new tests in tests/test_indexing.py to verify the behavior of SortedIndex.

This commit evaluates and uses efficient data structures (hash maps and a sorted index) for maintaining indices and optimizes SELECT queries accordingly.


Detailed Changes: v1.1.0...v1.2.0

v1.1.0

29 Mar 12:58
Compare
Choose a tag to compare

v1.1.0 (2025-03-29)

Documentation

  • Add project logo to README.md (9b5ff9c)

  • Add the project logo (965a44e)

  • Update documentation to remove useless line (5968ed0)

Features

  • persistence: Add an automatic backup system that saves the current state of the database either periodically or immediately after significant changes (32647a8)

The changes introducing an automatic backup system for DictDB. A new module,backup.py, defines a BackupManager that starts a background thread to periodically back up the database and also provides a manual trigger via notify_change(). Unit tests in test_backup.py verify both periodic and manual backup functionality.

  • persistence: Add asynchronous save/load methods (974036d)

Implemented async_save and async_load in DictDB using asyncio.to_thread to offload file I/O, ensuring that persistence operations do not block ongoing database activities. Updated documentation and unit tests (test_persistence.py) to cover asynchronous JSON and pickle operations.

  • persistence: Add save/load functionality with pathlib support (149f471)

  • Implemented save(filename: Union[str, Path], file_format: str) and load(filename: Union[str, Path], file_format: str) in database.py.

  • Updated Table class with getstate and setstate to exclude dynamic attributes from pickled state.

  • Refactored Field class to use a top-level _FieldCondition (with operator functions) ensuring picklability.

  • Updated relevant unit tests to cover persistence functionality.

Testing

  • persistence: Validate consistency across multiple save/load cycles (4054721)

Added a new unit test in test_persistence.py to verify that DictDB maintains a consistent state across multiple save/load cycles using JSON persistence. This test saves and reloads the database repeatedly and compares the final state with the original.


Detailed Changes: v1.0.0...v1.1.0

v1.0.0

26 Mar 10:30
Compare
Choose a tag to compare

v1.0.0 (2025-03-26)

Bug Fixes

  • Add exceptions to handle duplicate keys and mising records (61b6ee4)

  • Add missing type annotations in tests to resolve mypy errors (d784dae)

  • Specify monkeypatch: pytest.MonkeyPatch in test_update_atomicity_partial_failure for test_table.py

  • Annotate test function parameters and return types in test_table.py

  • Add CaptureFixture[str] type parameters in test_logging.py

  • Provide return type (and parameter types if any) for fixture functions in conftest.py

  • Correct mypy path in CI workflow (d16bba3)

Update the mypy command to correctly target the 'src/dictdb' directory instead of 'dictdb', ensuring accurate type checks in the CI process. This resolves potential coverage and analysis issues during the workflow run.

  • Implement record insertion with schema validation (9415cc4)

  • Added SchemaValidationError to exceptions.py for handling schema mismatches.

  • Updated Table in core.py to accept an optional schema and validate records during insertion.

  • Updated init.py to export SchemaValidationError.

  • Extended unit tests in test_core.py to cover schema validation cases:

    • Valid record insertion with schema.
    • Handling of missing fields, extra fields, and wrong type values.
    • Auto-assignment of primary keys when using schema validation.
  • Verified that existing CRUD operations and query functionalities continue to work.

  • ci: Fetch entire commit history for semantic-release (0f93b55)

  • Updated the checkout step in ci.yml to use fetch-depth: 0.

  • Ensures semantic-release can reference older commits without encountering a missing SHA error.

  • ci: Fix a missing part of the commands for semantic-release inside the CI workflow (3a546a3)

  • core: Add full type annotations, Query wrapper, and comprehensive module documentation (6a59bcc)

  • Introduced Query class to safely wrap Condition objects and avoid implicit boolean conversion.

  • Added complete type annotations across all classes and methods (DictDB, Table, Field, Condition, Query).

  • Provided a detailed module-level docstring outlining purpose, components, and usage examples.

  • Refactored Table to store its name in "table_name" to enable dynamic Field access.

  • Implemented robust CRUD operations with proper exception handling (DuplicateKeyError, RecordNotFoundError).

  • logging: Separate Loguru configuration and add unit tests for console/file logs (58e509f)

  • Moved Loguru-based logging setup into a dedicated logging.py module.

  • Updated core.py to import and use the shared logger.

  • Added new tests verifying both console output (via capfd) and file-based logs.

  • Ensured CRUD operations and database initialization produce the expected log lines.

  • types: Introduce centralized types module to unify shared definitions (9e735c3)

  • Created types.py to house common type aliases: Record, Schema, Predicate

  • Updated references in condition.py, table.py, etc. to rely on these new aliases

Chores

  • Add CI Github Actions configuration (76ef306)

  • Add configuration file for tests (6161599)

  • Add coverage to project dependencies (0a29627)

  • Add dictdb package (195f1a4)

  • Add Jetbrains configuration to ignored files (c7806a9)

  • Add mypy as a dev dependency and hatchling as a build system (992b8b9)

  • Add python version file (a4fbee0)

  • Add roadmap to docs (bc02708)

  • Add uv configuration (4bebf69)

  • Remove now useless core module (def27a5)

  • Remove testing step from CI for now (a9a8789)

  • Update CI configuration to work properly (9b10413)

  • Update readme and license with proper info (accb020)

  • docs: Add or update Sphinx-style docstrings for test methods (5eb0c5a)

  • Added missing docstrings and updated existing ones for all test methods.

  • Ensured each method signature now has a clear Sphinx docstring including parameter descriptions.

  • Complies with project standards for clear, maintainable documentation.

  • tests: Split test_core.py into separate condition, table, and database test files (8c9c452)

  • Moved Field/Condition/Query tests into test_condition.py

  • Moved Table CRUD + schema tests into test_table.py

  • Moved DictDB multi-table tests into test_database.py

  • Removed the now-obsolete test_core.py

  • Improved test organization and maintainability

Continuous Integration

  • Update CI pipeline to use uv for linting, type checks, and coverage (d1b5af6)

  • Installed uv and synced dependencies from uv.lock

  • Added Ruff lint check, mypy type check, and coverage-based tests

  • Ensured test, linting, and coverage steps are integrated into GitHub Actions

Documentation

  • Add or update Sphinx docstrings across modules (3d034b3)

  • Thoroughly reviewed and refined docstrings for all modules, functions, methods, and classes.

  • Ensured each docstring complies with standard Sphinx documentation style.

  • No functional changes; purely documentation improvements.

  • Update roadmap.md (8305554)

Features

  • ci: Integrate semantic-release and improve CI workflow (3679c10)

  • Added a dedicated 'release' job that uses semantic-release to auto-bump the version, generate changelogs, and publish both GitHub releases and PyPI packages.

  • Updated pyproject.toml:

    • Added python-semantic-release to dev dependencies.
    • Configured [tool.semantic_release] to pull version from pyproject.toml, use 'main' branch, and automatically upload to PyPI.
    • Enabled major_on_zero and version_source to ensure correct SemVer handling.
  • Ensured GH_TOKEN and PYPI_TOKEN environment variables are used so that GitHub releases and PyPI publishing can occur in the release job.

This commit sets up fully automated semantic versioning and release processes for DictDB.

Refactoring

  • Refactor Table CRUD operations and auto-assign primary keys (5bbcdda)

  • Update the insert method to auto-assign a primary key if missing by determining the next available integer key.

  • Rename CRUD methods by removing the '_record(s)' suffix; methods are now named insert, select, update, and delete.

  • Update tests to reflect these changes, ensuring proper auto-assignment and method naming.

  • Restrict the creation of queries through the use of Condition (9a57b3e)

  • core: Break out core.py into smaller modules while keeping Table & Field together (bf3fb51)

  • Moved Condition and Query to condition.py

  • Created table.py for both Table and Field, since they’re closely related

  • Created database.py for the DictDB class

  • Updated __init__.py to re-export all public classes and functions

  • Removed the old core.py in favor of these new, focused modules

Testing

  • Update test suite for full DictDB module functionality and Query integration (82961c6)

  • Revised tests in test_core.py to use the new Query wrapper for condition expressions.

  • Expanded tests to cover all aspects of the module: Field operator overloading, Condition logic, Query combinations, and CRUD operations.

  • Updated conftest.py fixtures to create reliable Table and DictDB instances for testing.

  • Added tests for error cases to ensure proper exception raising and overall module stability.

0