Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sqlacodegen/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
_re_enum_check_constraint = re.compile(r"(?:.*?\.)?(.*?) IN \((.+)\)")
_re_enum_item = re.compile(r"'(.*?)(?<!\\)'")
_re_invalid_identifier = re.compile(r"(?u)\W")

POSTGRES_LIKE_NAMES = ("postgresql", "timescaledb",)

@dataclass
class LiteralImport:
Expand Down Expand Up @@ -646,7 +646,7 @@ def fix_column_types(self, table: Table) -> None:
pass

# PostgreSQL specific fix: detect sequences from server_default
if column.server_default and self.bind.dialect.name == "postgresql":
if column.server_default and self.bind.dialect.name in POSTGRES_LIKE_NAMES:
if isinstance(column.server_default, DefaultClause) and isinstance(
column.server_default.arg, TextClause
):
Expand Down
Loading