Skip to content

Releases: daireto/sqlactive

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 23 Mar 04:19

0.4.0 (2026-03-22)

Introduced breaking API changes in connection and execution handling to make async session management explicit and enforce a stronger shutdown flow.

Breaking Changes

  • execute() signature has changed:
    • Before: session was resolved from base_model (or ActiveRecordBaseModel by default).
    • Now: it requires async_scoped_session explicitly as the first argument.
  • DBConnection.close() signature has changed:
    • Before: accepted an optional base_model.
    • Now: takes no arguments.
  • SessionMixin.close_session() has been removed.

Changed

  • DBConnection.init_db() now supports multiple base models via *base_models.
  • DBConnection.close() now performs a hard shutdown flow:
    • removes the scoped session from the current scope with remove(),
    • unbinds async_sessionmaker via configure(bind=None),
    • and disposes the engine via dispose().

Fixed

  • After close(), attempts to reuse the session for query execution now fail explicitly due to missing bind (intended behavior to prevent accidental reuse).

Migration Notes

  • Replace:
    • await execute(query, BaseModel)await execute(conn.async_scoped_session, query)
    • await conn.close(BaseModel)await conn.close()
  • If you relied on SessionMixin.close_session(), remove that call and manage lifecycle through DBConnection.close().

v0.3.6

Choose a tag to compare

@github-actions github-actions released this 06 Jun 03:59

0.3.6 (2025-06-05)

Introduced improvements in object manipulation using the magic methods __getitem__ and __setitem__, as well as enhancements in documentation and project configuration.

Added

  • Implementation of the magic methods __getitem__ and __setitem__ for more flexible data handling.

Enhancements

  • Resolved issues with ruff in docstrings and code, improving overall project quality.
  • Added ruff configuration to standardize code format and style.

Fixed

  • Corrections in docstrings and code to comply with ruff rules.

Refactored

  • Changed multiple functions to imperative mode for better code clarity.

Documentation

  • Added usage examples for the methods __getitem__ and __setitem__.
  • Updated function and property descriptions across the API documentation.

v0.3.5

Choose a tag to compare

@github-actions github-actions released this 14 May 00:17

0.3.5 (2025-05-13)

Added new specific exceptions and improved docstring formatting.

Added

  • Introduced new specific exceptions to enhance error handling.

Fixed

  • Resolved issues in docstrings and improved formatting using Ruff.
  • Corrected the use of exceptions in documentation.
  • Fixed minor issues in package configuration.

Refactored

  • Updated module and class docstrings for better clarity.
  • Reformatted code using Ruff for consistency.

v0.3.4

Choose a tag to compare

@github-actions github-actions released this 21 Apr 04:24

0.3.4 (2025-04-20)

Fixed error when searching on a model with more than two searchable columns.

Fixed

  • Fixed error with the or_ SQLAlchemy's operator when calling search() on a model that has more than two searchable columns.

v0.3.3

Choose a tag to compare

@github-actions github-actions released this 17 Mar 02:18

0.3.3 (2025-03-16)

Introduces a new type for queries and improves the code structure by moving independent functions to the utils module.

Added

  • Added Query type for Select[tuple[T, ...]].
  • Added get_query_root_cls util function to get the root class of a sqlalchemy.sql.Select instance.

Enhancements

  • Moved flatten_nested_filter_keys, create_eager_load_option, and eager_expr_from_schema functions from SmartQueryMixin to utils.

Documentation

  • Updated the documentation to reflect the changes.

v0.3.2

Choose a tag to compare

@github-actions github-actions released this 12 Mar 22:58

0.3.2 (2025-03-12)

Changes the way the Self type is imported depending on the Python version.

Fixed

  • Change Self type import: Use typing_extensions.Self for Python versions < 3.11 and typing.Self for Python versions >= 3.11.

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 04 Mar 04:25

0.3.1 (2025-03-03)

Introduces improvements in exception handling, code optimization, and updated documentation to reflect recent changes.

Added

  • New custom exceptions: Added new custom exceptions to improve error management.

Enhancements

  • Improved error messages: Error messages are now more descriptive, providing better feedback to users.
  • Code optimization: Refactored the code to improve readability and efficiency.

Fixed

  • Use SQLAlchemyError instead of a custom exception: Now using the native SQLAlchemy exception for better compatibility and consistency with the library.

Documentation

  • Updated the documentation to reflect the changes, including the Raises section for exception handling.

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 22 Feb 19:55

0.3.0 (2025-02-22)

Introduced context manager functionality to use temporary records, custom exceptions, and validation improvements. Enhanced ORM handling, added new column types, refined documentation and formatted code.

Added

  • Context manager functionality.
  • Introduced distinct() and take() functions.
  • Custom exceptions for different cases.

Enhancements

  • Enhanced support for retrieving models with composite primary keys using the get() and get_or_fail() methods.
  • Replaced inspect(cls).mapper with __mapper__.
  • Attribute validation in the fill() method.
  • New types for columns and attributes.

Fixed

  • Improved docstrings and code formatting.
  • Fixed examples and documentation.
  • Using the select_columns argument of group_by method was replacing the query by a new one.

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 11 Feb 00:57

0.2.0 (2025-02-10)

Added new query methods for counting and searching rows. The select query method has been improved to allow replacing the columns clause without affecting other clauses such as FROM, ORDER BY, and GROUP BY.

Added

  • Introduced top, count, unique_count, and search query methods.

Enhancements

  • Improved the select query method to preserve existing clauses, including FROM.

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 09 Feb 23:12

0.1.0 (2025-02-09)

First release.

Features

  • Asynchronous Support: Async operations for better scalability.
  • ActiveRecord-like methods: Perform CRUD operations with a syntax similar to Peewee.
  • Django-like queries: Perform intuitive and expressive queries.
  • Nested eager loading: Load nested relationships efficiently.
  • Automatic timestamps: Auto-manage created_at and updated_at fields.
  • Dictionary serialization: Convert models to JSON-friendly dictionaries with ease.