Below seems to work but I'm new to SQLAlchemy, so I don't know what kind of problems this will cause:
class Base(DeclarativeBase, MappedAsDataclass):
@classmethod
def __init_subclass__(cls, **kwargs):
cls.__tablename__ = cls.__name__.lower()
super().__init_subclass__(**kwargs)
Atleast you don't need to create with functions