diff --git a/singer_sdk/helpers/capabilities.py b/singer_sdk/helpers/capabilities.py index 55aff8ce3..f5b5fa305 100644 --- a/singer_sdk/helpers/capabilities.py +++ b/singer_sdk/helpers/capabilities.py @@ -99,6 +99,13 @@ description="The default target database schema name to use for all streams.", ), ).to_dict() +ADD_RECORD_METADATA_CONFIG = PropertiesList( + Property( + "add_record_metadata", + BooleanType(), + description="Add metadata to records.", + ), +).to_dict() class DeprecatedEnum(Enum): diff --git a/singer_sdk/target_base.py b/singer_sdk/target_base.py index 91bce6526..a5386199f 100644 --- a/singer_sdk/target_base.py +++ b/singer_sdk/target_base.py @@ -17,6 +17,7 @@ from singer_sdk.helpers._classproperty import classproperty from singer_sdk.helpers._compat import final from singer_sdk.helpers.capabilities import ( + ADD_RECORD_METADATA_CONFIG, BATCH_CONFIG, TARGET_SCHEMA_CONFIG, CapabilitiesEnum, @@ -595,6 +596,8 @@ def _merge_missing(source_jsonschema: dict, target_jsonschema: dict) -> None: if k not in target_jsonschema["properties"]: target_jsonschema["properties"][k] = v + _merge_missing(ADD_RECORD_METADATA_CONFIG, config_jsonschema) + capabilities = cls.capabilities if PluginCapabilities.BATCH in capabilities: diff --git a/tests/core/test_target_base.py b/tests/core/test_target_base.py index f9b342d39..de344c7e3 100644 --- a/tests/core/test_target_base.py +++ b/tests/core/test_target_base.py @@ -75,6 +75,7 @@ def test_target_about_info(): assert "flattening_enabled" in about.settings["properties"] assert "flattening_max_depth" in about.settings["properties"] assert "batch_config" in about.settings["properties"] + assert "add_record_metadata" in about.settings["properties"] def test_sql_get_sink():