

#SQLITE AUTOINCREMENT ONLY UNIQUE CODE#
In other ORM and hand written code they and we just use SQLite autoincrement directly. I was a user of force_insert=True because I was creating an object for the first time and when I was looked at the table that peewee itself created with its default id primary key column it was like "id" INTEGER NOT NULL PRIMARY KEY with no auto-increment! So I did exactly what you and the documentation said to do: used force_insert=True because when I look at table schema it has a, as you said, "a non-auto-incrementing primary key"! I see not auto-increment in the column definition so it is by definition not non-auto-incrementing primary key! Now I know this wrong apparently in peewee land but the documentations are not clear at all so I ask for clarification.I think it be very helpful if the documentations are fixed to be clear about how SQLite is different from what would be expected by long time SQLite users and SQLite users who have used other ORM with SQLite that works in ways different from peewee. I would contributes the documentation changes by my written English is not so good! But the documentations should be there to help us not confuse us with things that are misleading or wrong or if they do not say we should beware of surprises that would surprise us. They also do not explain very unexpected behaviors with SQLite like there being no autoincrement. The documentations say it is ok to do things that it is not ok to do apparently, like use force_insert=True. Right now the documentations are very misleading and the actual behaviors are very surprising. The reason for there being no autoincrement for the SQLite would be good note in documentation so we know what going on! It is very confusing when the documentation say "Because we have not specified a primary key, peewee will automatically add an auto-incrementing integer primary key field named id." but there is no warning that SQLite has special handlings!.I was doing an insert so being able to force it is something I should be able to do, no? The documentations say "If force_insert=True an INSERT will be issued regardless of whether or not the primary key exists." And I do not see the documentations warning me that I should not use it or not use it if I am using SQLite! So I think the documentations are very misleading and maybe even wrong in this case. The error should be more obvious or force_insert=True should be ok to use all the time.

I do not see why using force_insert=True should cause the code to fail with such an unobvious error.I think there are still bugs here even if some of them are just bugs with the documentations. I remove the force_insert=True and it does work! Many thank yous!
