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.

boolean_to_jsonschema(column_type)[source]

Return a JSON Schema representation of a boolean type.

Parameters:

column_type (Boolean) – The column type.

Return type:

dict

date_to_jsonschema(column_type)[source]

Return a JSON Schema representation of a date type.

Parameters:

column_type (Date) – The column type.

Return type:

dict

datetime_to_jsonschema(column_type)[source]

Return a JSON Schema representation of a generic datetime type.

Parameters:

column_type (DateTime) – The column type.

Return type:

dict

float_to_jsonschema(column_type)[source]

Return a JSON Schema representation of a generic number type.

Parameters:

column_type (Numeric) – The column type.

Return type:

dict

integer_to_jsonschema(column_type)[source]

Return a JSON Schema representation of a an integer type.

Parameters:

column_type (Integer) – The column type.

Return type:

dict

string_to_jsonschema(column_type)[source]

Return a JSON Schema representation of a generic string type.

Parameters:

column_type (String) – The column type.

Return type:

dict

Changed in version 0.41.0: The length attribute is now used to determine the maximum length of the string type.

time_to_jsonschema(column_type)[source]

Return a JSON Schema representation of a time type.

Parameters:

column_type (Time) – The column type.

Return type:

dict