def values(table, row, columns):
    """
    Formats and converts row into database types based on table schema.

    Args:
        table: table schema
        row: row tuple
        columns: column names

    Returns:
        Database schema formatted row tuple
    """

    values = []
    for x, column in enumerate(columns):
        # Get value
        value = row[x]

        if table[column].startswith('INTEGER'):
            values.append(int(value) if value else 0)
        elif table[column] == 'BOOLEAN':
            values.append(1 if value == "TRUE" else 0)
        else:
            values.append(value)

    return values