snipy/database.py
def insert(cursor, table, *args, **field_values):
    """
    db에 레코드 집어넣기
    ex)
    cursor.insert(table, v1, v2,...)
    ex)
    cursor.insert(table, id=v1, word=v2, commit=True)
    :param commit:
    :param cursor:
    :param table:
    :param args:
    :param field_values:
    :return:
    """
    commit = field_values.pop('commit', True)

    q, a = None, None
    if args is not None and len(args) > 0:
        q = get_insert_query(table, field_count=len(args))
        a = args
    elif len(field_values) > 0:
        q = get_insert_query(table, fields=field_values.keys())
        a = field_values.values()
    else:
        raise ValueError('need table, record...')

    cursor.execute(q, args=a)
    if commit:
        cursor.connection.commit()
def insert(cursor, table, *args, **field_values):
    """
    db에 레코드 집어넣기
    ex)
    cursor.insert(table, v1, v2,...)
    ex)
    cursor.insert(table, id=v1, word=v2, commit=True)
    :param commit:
    :param cursor:
    :param table:
    :param args:
    :param field_values:
    :return:
    """
    commit = field_values.pop('commit', True)

    q, a = None, None
    if args is not None and len(args) > 0:
        q = get_insert_query(table, field_count=len(args))
        a = args
    elif len(field_values) > 0:
        q = get_insert_query(table, fields=field_values.keys())
        a = field_values.values()
    else:
        raise ValueError('need table, record...')

    cursor.execute(q, args=a)
    if commit:
        cursor.connection.commit()
db에 레코드 집어넣기
    ex)
    cursor.insert(table, v1, v2,...)
    ex)
    cursor.insert(table, id=v1, word=v2, commit=True)
    :param commit:
    :param cursor:
    :param table:
    :param args:
    :param field_values:
    :return: