File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -175,10 +175,10 @@ session.execute(text('CREATE EXTENSION IF NOT EXISTS vector'))
175175Add a vector column
176176
177177``` python
178- from pgvector.sqlalchemy import VECTOR
178+ from pgvector.sqlalchemy import Vector
179179
180180class Item (Base ):
181- embedding = mapped_column(VECTOR (3 ))
181+ embedding = mapped_column(Vector (3 ))
182182```
183183
184184Also supports ` HALFVEC ` , ` BIT ` , and ` SPARSEVEC `
@@ -274,11 +274,11 @@ session.scalars(select(Item).order_by(order).limit(5))
274274Add an array column
275275
276276``` python
277- from pgvector.sqlalchemy import VECTOR
277+ from pgvector.sqlalchemy import Vector
278278from sqlalchemy import ARRAY
279279
280280class Item (Base ):
281- embeddings = mapped_column(ARRAY(VECTOR (3 )))
281+ embeddings = mapped_column(ARRAY(Vector (3 )))
282282```
283283
284284And register the types with the underlying driver
@@ -327,10 +327,10 @@ session.exec(text('CREATE EXTENSION IF NOT EXISTS vector'))
327327Add a vector column
328328
329329``` python
330- from pgvector.sqlalchemy import VECTOR
330+ from pgvector.sqlalchemy import Vector
331331
332332class Item (SQLModel , table = True ):
333- embedding: Any = Field(sa_type = VECTOR (3 ))
333+ embedding: Any = Field(sa_type = Vector (3 ))
334334```
335335
336336Also supports ` HALFVEC ` , ` BIT ` , and ` SPARSEVEC `
You can’t perform that action at this time.
0 commit comments