from typing import List


def _format_sql_query(
    query_path: str,
    strings_to_insert: List[str] = [],
) -> str:
    """
    Loads a sql query from a file and inserts parameter strings
    """
    # Get SQL query from file as string
    with open(query_path, "r") as f:
        sql = f.read()

    # Insert format string into {} in query string
    sql = sql.format(*strings_to_insert)

    # Remove leading and trailing whitespaces
    sql = sql.strip()

    # Remove carriage return characters
    sql = sql.replace("\r", "")

    return sql