def insert(cursor, table, *args, **field_values):
commit = field_values.pop('<STR_LIT>', True)<EOL>q, a = None, None<EOL>if args is not None and len(args) > <NUM_LIT:0>:<EOL><INDENT>q = get_insert_query(table, field_count=len(args))<EOL>a = args<EOL><DEDENT>elif len(field_values) > <NUM_LIT:0>:<EOL><INDENT>q = get_insert_query(table, fields=field_values.keys())<EOL>a = field_values.values()<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>cursor.execute(q, args=a)<EOL>if commit:<EOL><INDENT>cursor.connection.commit()<EOL><DEDENT>
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: