forked from mtusi2026/mtusi2026lab5
14 lines
394 B
Python
14 lines
394 B
Python
from sqlalchemy import BigInteger, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.models.base import Base
|
|
|
|
|
|
class Counter(Base):
|
|
"""Именованный счётчик с атомарным обновлением."""
|
|
|
|
__tablename__ = "counters"
|
|
|
|
name: Mapped[str] = mapped_column(String(64), primary_key=True)
|
|
value: Mapped[int] = mapped_column(BigInteger)
|