mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-23 08:23:00 +08:00
19 lines
447 B
Python
19 lines
447 B
Python
from sqlalchemy import Column, String
|
|
from sqlalchemy.orm import DeclarativeBase
|
|
from sqlalchemy.ext.asyncio import AsyncAttrs
|
|
|
|
from core.uid_gen import get_flake_uid
|
|
|
|
|
|
class BaseEntity(DeclarativeBase, AsyncAttrs):
|
|
__name__: str
|
|
__abstract__ = True
|
|
__mapper_args__ = {"eager_defaults": True}
|
|
|
|
uid = Column(
|
|
String,
|
|
primary_key=True,
|
|
index=True,
|
|
nullable=False,
|
|
default=get_flake_uid,
|
|
)
|