def table_exists(cursor, table_name):
    """
    Checks if the table table_name exists in the database.
    returns true if the table exists in the database, false otherwise.

    :param cursor: the cursor to the database's connection
    :type cursor: Cursor
    :param table_name: the name of the table searching for
    :type table_name: str
    :return: true if the table exists, false otherwise
    :rtype: bool
    """
    cursor.execute("""
                       SELECT name 
                       FROM sqlite_master 
                       WHERE type='table' AND name=?;
                   """,
                   (table_name,))
    return bool(cursor.fetchone())