Skip to content

Commit

Permalink
feat: add postgresql data_source db_version
Browse files Browse the repository at this point in the history
  • Loading branch information
ovsds committed Dec 8, 2023
1 parent b92e1df commit dfba0d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class PostgreSQLDataSourceMixin(BaseSQLDataSource):
def is_compatible_with_type(cls, source_type: DataSourceType) -> bool:
return source_type in (SOURCE_TYPE_PG_TABLE, SOURCE_TYPE_PG_SUBSELECT)

def get_connect_args(self) -> dict:
return dict(super().get_connect_args(), server_version=self.db_version)


class PostgreSQLDataSource(PostgreSQLDataSourceMixin, StandardSchemaSQLDataSource):
"""PG table"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ class PostgresAdapter(BasePostgresAdapter, BaseClassicAdapter[PostgresConnTarget
}

def get_connect_args(self) -> dict:
return {
"sslmode": "require" if self._target_dto.ssl_enable else "prefer",
"sslrootcert": self.get_ssl_cert_path(self._target_dto.ssl_ca),
}
return dict(
super().get_connect_args(),
sslmode="require" if self._target_dto.ssl_enable else "prefer",
sslrootcert=self.get_ssl_cert_path(self._target_dto.ssl_ca),
)

def get_engine_kwargs(self) -> dict:
result: Dict = {}
Expand Down

0 comments on commit dfba0d8

Please sign in to comment.