async_storages.integrations

class async_storages.integrations.sqlalchemy.FileType(storage: BaseStorage, *args: Any, **kwargs: Any)[source]

Bases: TypeDecorator

SQLAlchemy column type for representing stored files.

This type integrates with BaseStorage to automatically wrap database values (file names) into StorageFile objects when queried.

Parameters:
  • storage (BaseStorage) – The storage backend used to manage file operations.

  • args – Additional positional arguments passed to TypeDecorator.

  • kwargs – Additional keyword arguments passed to TypeDecorator.

class async_storages.integrations.sqlalchemy.ImageType(storage: BaseStorage, *args: Any, **kwargs: Any)[source]

Bases: FileType

SQLAlchemy column type for representing stored image files.

This type extends FileType to automatically wrap database values (image file names) into StorageImage objects when queried.

It integrates with a configured BaseStorage backend to provide convenient access to image operations such as resizing, thumbnail generation, or metadata retrieval.

Parameters:
  • storage (BaseStorage) – The storage backend used to manage image file operations.

  • args – Additional positional arguments passed to FileType.

  • kwargs – Additional keyword arguments passed to FileType.