Skip to content

models

Here's the reference for the SQLAlchemy model mixins provided by the models module.

You can import them directly from fastapi_toolsets.models:

from fastapi_toolsets.models import (
    UUIDMixin,
    UUIDv7Mixin,
    CreatedAtMixin,
    UpdatedAtMixin,
    TimestampMixin,
)

fastapi_toolsets.models.UUIDMixin

Mixin that adds a UUID primary key auto-generated by the database.

fastapi_toolsets.models.UUIDv7Mixin

Mixin that adds a UUIDv7 primary key auto-generated by the database.

fastapi_toolsets.models.CreatedAtMixin

Mixin that adds a created_at timestamp column.

fastapi_toolsets.models.UpdatedAtMixin

Mixin that adds an updated_at timestamp column.

fastapi_toolsets.models.TimestampMixin

Bases: CreatedAtMixin, UpdatedAtMixin

Mixin that combines created_at and updated_at timestamp columns.