types

Type aliases and constants used in the package config.

class advanced_alchemy.config.types.Any[source]

Bases: object

Special type indicating an unconstrained type.

  • Any is compatible with every type.

  • Any assumed to have all methods.

  • All values assumed to be instances of Any.

Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should not be used with instance checks.

static __new__(cls, *args, **kwargs)[source]
advanced_alchemy.config.types.TypeEncodersMap: TypeAlias = 'Mapping[Any, Callable[[Any], Any]]'

Type alias for a mapping of type encoders.

Maps types to their encoder functions.

advanced_alchemy.config.types.TypeDecodersSequence: TypeAlias = 'Sequence[Tuple[Callable[[Any], bool], Callable[[Any, Any], Any]]]'

Type alias for a sequence of type decoders.

Each tuple contains a type check predicate and its corresponding decoder function.

advanced_alchemy.config.types.CommitStrategy

Commit strategy for SQLAlchemy sessions.

Values:

always: Always commit the session after operations match_status: Only commit if the HTTP status code indicates success

alias of Literal[‘always’, ‘match_status’]