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

Class Report

examples/sharding/asyncio.py:105–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105class Report(Base):
106 __tablename__ = "weather_reports"
107
108 id: Mapped[int] = mapped_column(primary_key=True)
109 location_id: Mapped[int] = mapped_column(
110 ForeignKey("weather_locations.id")
111 )
112 temperature: Mapped[float]
113 report_time: Mapped[datetime.datetime] = mapped_column(
114 default=datetime.datetime.now
115 )
116
117 location: Mapped[WeatherLocation] = relationship(back_populates="reports")
118
119 def __init__(self, temperature: float):
120 self.temperature = temperature
121
122
123# step 5. 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