def METHOD_NAME(
    cls, target_type: str, dttm: datetime, db_extra: dict[str, Any] | None = None
) -> str | None:
    sqla_type = cls.get_sqla_column_type(target_type)
    if isinstance(sqla_type, types.Date):
        return f"CAST(TIME_PARSE('{dttm.date().isoformat()}') AS DATE)"
    if isinstance(sqla_type, (types.DateTime, types.TIMESTAMP)):
        return f"""TIME_PARSE('{dttm.isoformat(timespec="seconds")}')"""
    return None