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

Class Report

examples/sharding/separate_databases.py:89–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89class Report(Base):
90 __tablename__ = "weather_reports"
91
92 id: Mapped[int] = mapped_column(primary_key=True)
93 location_id: Mapped[int] = mapped_column(
94 ForeignKey("weather_locations.id")
95 )
96 temperature: Mapped[float]
97 report_time: Mapped[datetime.datetime] = mapped_column(
98 default=datetime.datetime.now
99 )
100
101 location: Mapped[WeatherLocation] = relationship(back_populates="reports")
102
103 def __init__(self, temperature: float):
104 self.temperature = temperature
105
106
107# 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