Skip to content
Draft
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
8 changes: 8 additions & 0 deletions tap_postgres/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ class PostgresStream(SQLStream):
# JSONB Objects won't be selected without type_conformance_level to ROOT_ONLY
TYPE_CONFORMANCE_LEVEL = TypeConformanceLevel.ROOT_ONLY

@functools.cached_property
def schema(self) -> dict:
"""Override schema adding _sdc columns."""
schema_dict = self._singer_catalog_entry.schema.to_dict()
schema_dict["properties"]["_sdc_postgres_schema"] = {"type": ["string", "null"]}
return schema_dict

def max_record_count(self) -> int | None:
"""Return the maximum number of records to fetch in a single query."""
return self.config.get("max_record_count")
Expand Down Expand Up @@ -280,6 +287,7 @@ def get_records(self, context: Context | None) -> t.Iterable[dict[str, t.Any]]:
if transformed_record is None:
# Record filtered out during post_process()
continue
transformed_record["_sdc_postgres_schema"] = table.schema
yield transformed_record


Expand Down
Loading