Advanced-alchemy

Latest version: v1.0.1

Safety actively analyzes 722032 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 5

0.21.0

:date: 2025-01-11

.. change:: bind session to session class instead of to the session maker
:type: bugfix
:pr: 268
:issue: 267

binds session into sanic extension as expected

in the original code, session maker was defined and then the dependency for session overwrites it with a session maker as the type. this seems non-ideal -- you can't get the session maker and when you ask for the session maker you get a session object

instead, this looks at the sessionmaker `class_` property for adding the sanic dependency


.. change:: correct regex mappings for duplicate and foreign key errors
:type: bugfix
:pr: 266
:issue: 262

Swap the variable names for DUPLICATE_KEY_REGEXES and FOREIGN_KEY_REGEXES to correctly match their contents.
This ensures that the error detection for duplicate keys and foreign key violations works as intended across different database backends.

.. change:: Dump all tables as JSON
:type: feature
:pr: 259

Adds a new CLI command to export tables to JSON. Similar to a Django dumpdata command.

0.20.0

:date: 2025-01-11

.. change:: CollectionFilter returns all entries if values is empty
:type: bugfix
:pr: 52
:issue: 51

Fixes 51

Bug: CollectionFilter returns all entries if values is empty

a simple `1=-1` is appended into the `where` clause when an empty list is passed into the `in` statement.

.. change:: better handle empty collection filters
:type: bugfix
:pr: 62

Currently, [this](https://github.com/cofin/litestar-fullstack/blob/main/src/app/lib/dependencies.py#L169) is how you can inject these filters in your app.

When using the `id_filter` dependency on it's own, you have to have an additional not-null check before passing it into the repository.

This change handles that and allows you to pass in all filters into the repository function without checking their nullability.

.. change:: service `exists` should use `exists` from repository
:type: bugfix
:pr: 68

The service should use the repository's implementation of `exists` instead of a new one with a `count`.

.. change:: do not set `id` with `item_id` when `None`
:type: bugfix
:pr: 67

This PR prevents the primary key from being overrwitten with `None` when using the service without the `item_id` parameter.

.. change:: sqlalchemy dto for models non `Column` fields
:type: bugfix
:pr: 75

Examples of such fields are `ColumnClause` and `Label`, these are generated when using `sqlalchemy.func`

- Fix SQLAlchemy dto generation for litestar when using models that have fields that are not instances of `Column`. Such fields arise from using expressions such as `func`.

Page 5 of 5

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.