singer_sdk.connectors.sql.SQLToJSONSchema¶
- class singer_sdk.connectors.sql.SQLToJSONSchema[source]¶
SQLAlchemy to JSON Schema type mapping helper.
This class provides a mapping from SQLAlchemy types to JSON Schema types.
Added in version 0.41.0.
Changed in version 0.43.0: Added the
singer_sdk.connectors.sql.SQLToJSONSchema.from_config()
class method.- datetime_to_jsonschema(column_type)[source]¶
Return a JSON Schema representation of a generic datetime type.
- float_to_jsonschema(column_type)[source]¶
Return a JSON Schema representation of a generic number type.
- classmethod from_config(config)[source]¶
Create a new instance from a configuration dictionary.
Override this to instantiate this converter with values from the tap’s configuration dictionary.
class CustomSQLToJSONSchema(SQLToJSONSchema): def __init__(self, *, my_custom_option, **kwargs): super().__init__(**kwargs) self.my_custom_option = my_custom_option @classmethod def from_config(cls, config): return cls(my_custom_option=config.get("my_custom_option"))
- Parameters:
config (dict) – The configuration dictionary.
- Returns:
A new instance of the class.
- Return type:
- integer_to_jsonschema(column_type)[source]¶
Return a JSON Schema representation of a an integer type.