Skip to content

Commit

Permalink
Update generators.py
Browse files Browse the repository at this point in the history
Allow for spaces between enum options
  • Loading branch information
Dsolnik committed Sep 28, 2023
1 parent c68d2a8 commit fe5ed72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sqlacodegen/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
from importlib.metadata import version

_sqla_version = tuple(int(x) for x in version("sqlalchemy").split(".")[:2])
_re_boolean_check_constraint = re.compile(r"(?:.*?\.)?(.*?) IN \(0, 1\)")
_re_boolean_check_constraint = re.compile(r"(?:.*?\.)?(.*?)\s+IN\s*\(0, 1\)")
_re_column_name = re.compile(r'(?:(["`]?).*\1\.)?(["`]?)(.*)\2')
_re_enum_check_constraint = re.compile(r"(?:.*?\.)?(.*?) IN \((.+)\)")
_re_enum_check_constraint = re.compile(r"(?:.*?\.)?(.*?)\s+IN\s*\((.+)\)")
_re_enum_item = re.compile(r"'(.*?)(?<!\\)'")
_re_invalid_identifier = re.compile(r"(?u)\W")

Expand Down

0 comments on commit fe5ed72

Please sign in to comment.