Skip to content

Commit

Permalink
docs: Add example to method docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jan 15, 2025
1 parent c8216dd commit 70a395e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 70a395e

Please sign in to comment.