MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / Report

Class Report

examples/sharding/separate_tables.py:103–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102
103class Report(Base):
104 __tablename__ = "_prefix__weather_reports"
105
106 id: Mapped[int] = mapped_column(primary_key=True)
107 location_id: Mapped[int] = mapped_column(
108 ForeignKey("_prefix__weather_locations.id")
109 )
110 temperature: Mapped[float]
111 report_time: Mapped[datetime.datetime] = mapped_column(
112 default=datetime.datetime.now
113 )
114
115 location: Mapped[WeatherLocation] = relationship(back_populates="reports")
116
117 def __init__(self, temperature: float):
118 self.temperature = temperature
119
120
121# define sharding functions.

Callers 1

mainFunction · 0.70

Calls 3

mapped_columnFunction · 0.90
ForeignKeyClass · 0.90
relationshipFunction · 0.90

Tested by

no test coverage detected