Skip to content

Commit bd36d64

Browse files
committed
Use session [skip ci]
1 parent a3b8e84 commit bd36d64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_sqlalchemy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from sqlalchemy.sql import func
88

99
engine = create_engine('postgresql+psycopg2://localhost/pgvector_python_test')
10-
with engine.connect() as con:
11-
con.execute(text('CREATE EXTENSION IF NOT EXISTS vector'))
12-
con.commit()
10+
with Session(engine) as session:
11+
session.execute(text('CREATE EXTENSION IF NOT EXISTS vector'))
12+
session.commit()
1313

1414
Base = declarative_base()
1515

0 commit comments

Comments
 (0)