|
7 | 7 | from sqlalchemy.exc import StatementError |
8 | 8 | from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine, AsyncEngine |
9 | 9 | from sqlalchemy.ext.automap import automap_base |
10 | | -from sqlalchemy.orm import mapped_column, DeclarativeBase, Session |
| 10 | +from sqlalchemy.orm import mapped_column, DeclarativeBase, Mapped, Session |
11 | 11 | from sqlalchemy.sql import func |
12 | 12 | from typing import Any |
13 | 13 |
|
@@ -78,13 +78,13 @@ class Base(DeclarativeBase): |
78 | 78 | class Item(Base): |
79 | 79 | __tablename__ = 'sqlalchemy_orm_item' |
80 | 80 |
|
81 | | - id = mapped_column(Integer, primary_key=True) |
82 | | - embedding = mapped_column(VECTOR(3)) |
83 | | - half_embedding = mapped_column(HALFVEC(3)) |
84 | | - binary_embedding = mapped_column(BIT(3)) |
85 | | - sparse_embedding = mapped_column(SPARSEVEC(3)) |
86 | | - embeddings = mapped_column(ARRAY(VECTOR(3))) |
87 | | - half_embeddings = mapped_column(ARRAY(HALFVEC(3))) |
| 81 | + id: Mapped[int] = mapped_column(Integer, primary_key=True) |
| 82 | + embedding: Mapped[Vector] = mapped_column(VECTOR(3)) |
| 83 | + half_embedding: Mapped[HalfVector] = mapped_column(HALFVEC(3)) |
| 84 | + binary_embedding: Mapped[Any] = mapped_column(BIT(3)) |
| 85 | + sparse_embedding: Mapped[SparseVector] = mapped_column(SPARSEVEC(3)) |
| 86 | + embeddings: Mapped[list[Vector]] = mapped_column(ARRAY(VECTOR(3))) |
| 87 | + half_embeddings: Mapped[list[HalfVector]] = mapped_column(ARRAY(HALFVEC(3))) |
88 | 88 |
|
89 | 89 |
|
90 | 90 | Base.metadata.drop_all(setup_engine) |
|
0 commit comments