Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serial field won't work in SQLite if it is not the primary key #981

Open
metakot opened this issue Apr 11, 2024 · 0 comments
Open

Serial field won't work in SQLite if it is not the primary key #981

metakot opened this issue Apr 11, 2024 · 0 comments

Comments

@metakot
Copy link

metakot commented Apr 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant