| 21 | |
| 22 | |
| 23 | class Vertex(Base): |
| 24 | __tablename__ = "vertices" |
| 25 | |
| 26 | id: Mapped[int] = mapped_column(primary_key=True) |
| 27 | x1: Mapped[int] |
| 28 | y1: Mapped[int] |
| 29 | x2: Mapped[int] |
| 30 | y2: Mapped[int] |
| 31 | |
| 32 | # inferred from right hand side |
| 33 | start = composite(Point, "x1", "y1") |
| 34 | |
| 35 | # taken from left hand side |
| 36 | end: Mapped[Point] = composite(Point, "x2", "y2") |
| 37 | |
| 38 | |
| 39 | v1 = Vertex(start=Point(3, 4), end=Point(5, 6)) |
no test coverage detected