diff --git a/singer_sdk/connectors/sql.py b/singer_sdk/connectors/sql.py index ab3abfacd..84f15746f 100644 --- a/singer_sdk/connectors/sql.py +++ b/singer_sdk/connectors/sql.py @@ -349,12 +349,17 @@ def register_sql_datatype_handler( sql_datatype: str, handler: JSONtoSQLHandler, ) -> None: - """Register a custom x-sql-datatype handler. + """Register a custom ``x-sql-datatype`` handler. Args: sql_datatype: The x-sql-datatype string. handler: Either a SQLAlchemy type class or a callable that takes a schema dict and returns a SQLAlchemy type instance. + + Example: + >>> from sqlalchemy.types import SMALLINT + >>> to_sql = JSONSchemaToSQL() + >>> to_sql.register_sql_datatype_handler("smallint", SMALLINT) """ self._sql_datatype_mapping[sql_datatype] = handler