title: Peewee, MySQL and INSERT IGNORE
body: <p>I use Peewee as ORM in a little Python script with a MySQL DB.</p>
  
  <pre><code>#!/usr/bin/python3
  #coding: utf-8
  
  import peewee
  from peewee import *
  
  db = MySQLDatabase(**config)
  class Foo(peewee.Model):
      bar = peewee.CharField(unique=True, null=False)
      class Meta:
          database = db
  
  try:
      Foo.create_table()
  except:
      pass
  
  foo_data = [{'bar':'xyz'},{'bar':'xyz'}]
  Foo.insert_many(foo_data).on_conflict(action='IGNORE').execute()
  </code></pre>
  
  <p>As you can see, I have the same key. I'd like to ignore it the second time using the <code>on_conflict</code> method (<a href="http://docs.peewee-orm.com/en/latest/peewee/api.html#UpdateQuery.on_conflict" rel="nofollow noreferrer">described in the API reference</a>, but only for SQLite3), but I have this error when running the script (normal, because not implemented for MySQL):</p>
  
  <pre><code>peewee.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR IGNORE INTO `foo` (`bar`) VA' at line 1")
  </code></pre>
  
  <p>If I remove the <code>.on_conflict(action='IGNORE')</code>, MySQL doesn't like it either (duplicate key). How can I make peewee insert a new key or ignore it if it's a duplicate key?</p>