def quote_sql_string(value):
    """
    If "value" is a string type, escapes single quotes in the string
    and returns the string enclosed in single quotes.
    Thank you to https://towardsdatascience.com/a-simple-approach-to-templated-sql-queries-in-python-adc4f0dc511
    """
    if isinstance(value, str):
        new_value = str(value)
        new_value = new_value.replace("'", "''")
        return f"'{new_value}'"
    return value