Skip to content

Commit 0b6f137

Browse files
committed
Added support for the pgvector extension
1 parent 25f367c commit 0b6f137

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Version history
44
**UNRELEASED**
55

66
- Dropped support for Python 3.7
7+
- Added support for the ``pgvector`` extension (with help from KellyRousselHoomano)
78

89
**3.0.0rc3**
910

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ To include support for the PostgreSQL ``GEOMETRY``, ``GEOGRAPHY``, and ``RASTER`
4545
(which should be considered as tested only under a few environments) specify the
4646
``geoalchemy2`` extra:
4747

48+
To include support for the PostgreSQL ``PGVECTOR`` extension type, specify the
49+
``pgvector`` extra::
50+
51+
pip install sqlacodegen[pgvector]
52+
4853
.. code-block:: bash
4954
5055
pip install sqlacodegen[geoalchemy2]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ sqlmodel = [
5151
]
5252
citext = ["sqlalchemy-citext >= 1.7.0"]
5353
geoalchemy2 = ["geoalchemy2 >= 0.11.1"]
54+
pgvector = ["pgvector >= 0.2.4"]
5455

5556
[project.entry-points."sqlacodegen.generators"]
5657
tables = "sqlacodegen.generators:TablesGenerator"

src/sqlacodegen/cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
except ImportError:
1919
geoalchemy2 = None
2020

21+
try:
22+
import pgvector
23+
except ImportError:
24+
pgvector = None
25+
2126
if sys.version_info < (3, 10):
2227
from importlib_metadata import entry_points, version
2328
else:
@@ -61,10 +66,13 @@ def main() -> None:
6166
return
6267

6368
if citext:
64-
print(f"Using sqlalchemy-citext {citext.__version__}")
69+
print(f"Using sqlalchemy-citext {version('citext')}")
6570

6671
if geoalchemy2:
67-
print(f"Using geoalchemy2 {geoalchemy2.__version__}")
72+
print(f"Using geoalchemy2 {version('geoalchemy2')}")
73+
74+
if pgvector:
75+
print(f"Using pgvector {version('pgvector')}")
6876

6977
# Use reflection to fill in the metadata
7078
engine = create_engine(args.url)

0 commit comments

Comments
 (0)