Skip to content

Commit

Permalink
compile create column clause with sqla engine to ensure proper quotin…
Browse files Browse the repository at this point in the history
…g is applied
  • Loading branch information
haleemur committed Aug 1, 2024
1 parent 5eb1235 commit 6d89d02
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,8 +974,8 @@ def _get_column_type(

return column.type

@staticmethod
def get_column_add_ddl(
self,
table_name: str,
column_name: str,
column_type: sa.types.TypeEngine,
Expand All @@ -998,11 +998,12 @@ def get_column_add_ddl(
column_type,
),
)
compiled = create_column_clause.compile(self._engine)
return sa.DDL(
"ALTER TABLE %(table_name)s ADD COLUMN %(create_column_clause)s",
{
{ # type: ignore[arg-type]
"table_name": table_name,
"create_column_clause": create_column_clause,
"create_column_clause": compiled,
},
)

Expand Down

0 comments on commit 6d89d02

Please sign in to comment.