piccolo
piccolo copied to clipboard
`Serial` field won't work in SQLite if it is not the primary key
piccolo==1.5.0 piccolo_admin==1.3.2 piccolo_api==1.4.0
So I have a table in SQLite:
class Example(Table):
number = Serial()
When trying to save it
example = Example()
await example.save()
the sqlite error occuring:
sqlite3.IntegrityError: NOT NULL constraint failed: example.number
Apparently piccolo creates serial
field as just INTEGER
without AUTOINCREMENT
which is needed by SQLite.