File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -526,3 +526,20 @@ def connect(dbapi_connection, connection_record):
526526 assert item .embeddings [1 ].tolist () == [4 , 5 , 6 ]
527527
528528 await engine .dispose ()
529+
530+ @pytest .mark .asyncio
531+ @pytest .mark .skipif (sqlalchemy_version == 1 , reason = 'Requires SQLAlchemy 2+' )
532+ async def test_asyncpg_bit (self ):
533+ import asyncpg
534+
535+ engine = create_async_engine ('postgresql+asyncpg://localhost/pgvector_python_test' )
536+ async_session = async_sessionmaker (engine , expire_on_commit = False )
537+
538+ async with async_session () as session :
539+ async with session .begin ():
540+ embedding = asyncpg .BitString ('101' )
541+ session .add (Item (id = 1 , binary_embedding = embedding ))
542+ item = await session .get (Item , 1 )
543+ assert item .binary_embedding == embedding
544+
545+ await engine .dispose ()
You can’t perform that action at this time.
0 commit comments