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

Class Report

examples/sharding/separate_schema_translates.py:84–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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