Skip to content

Commit

Permalink
Added support for Geoalchemy2
Browse files Browse the repository at this point in the history
Fixes #29.
  • Loading branch information
agronholm committed May 7, 2018
1 parent 5e1bd42 commit c3f51d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Version history

* Added an option to only generate tables

* Added support for Geoalchemy2


1.1.6
-----
Expand Down
6 changes: 6 additions & 0 deletions sqlacodegen/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
from sqlalchemy.types import Boolean, String
from sqlalchemy.util import OrderedDict

# Conditionally import Geoalchemy2 to enable reflection support
try:
import geoalchemy2 # noqa: F401
except ImportError:
pass

_re_boolean_check_constraint = re.compile(r"(?:(?:.*?)\.)?(.*?) IN \(0, 1\)")
_re_column_name = re.compile(r'(?:(["`]?)(?:.*)\1\.)?(["`]?)(.*)\2')
_re_enum_check_constraint = re.compile(r"(?:(?:.*?)\.)?(.*?) IN \((.+)\)")
Expand Down

0 comments on commit c3f51d8

Please sign in to comment.