File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,12 @@ considered as tested only under a few environments) specify the ``citext`` extra
4141 pip install sqlacodegen[citext]
4242
4343
44+ To include support for the PostgreSQL ``GEOMETRY ``, ``GEOGRAPHY ``, and ``RASTER `` types (which should be
45+ considered as tested only under a few environments) specify the ``geoalchemy2 `` extra::
46+ pip install sqlacodegen[geoalchemy2]
47+
48+
49+
4450Quickstart
4551==========
4652
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ sqlmodel = [
5151 " sqlmodel" ,
5252]
5353citext = [" sqlalchemy-citext >= 1.7.0" ]
54+ geoalchemy2 = [" geoalchemy2 >= 0.11.1" ]
5455
5556[project .entry-points ."sqlacodegen .generators" ]
5657tables = " sqlacodegen.generators:TablesGenerator"
Original file line number Diff line number Diff line change 88from sqlalchemy .engine import create_engine
99from sqlalchemy .schema import MetaData
1010
11+ try :
12+ import citext
13+ except ImportError :
14+ citext = None
15+
16+ try :
17+ import geoalchemy2
18+ except ImportError :
19+ geoalchemy2 = None
20+
1121if sys .version_info < (3 , 10 ):
1222 from importlib_metadata import entry_points , version
1323else :
@@ -50,6 +60,12 @@ def main() -> None:
5060 parser .print_help ()
5161 return
5262
63+ if citext :
64+ print (f"Using sqlalchemy-citext { citext .__version__ } " )
65+
66+ if geoalchemy2 :
67+ print (f"Using geoalchemy2 { geoalchemy2 .__version__ } " )
68+
5369 # Use reflection to fill in the metadata
5470 engine = create_engine (args .url )
5571 metadata = MetaData ()
You can’t perform that action at this time.
0 commit comments