Skip to content

Create and friends ignore setting the PK #157

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

Open
coderanger opened this issue Jun 14, 2022 · 3 comments
Open

Create and friends ignore setting the PK #157

coderanger opened this issue Jun 14, 2022 · 3 comments

Comments

@coderanger
Copy link

Creating a row with a manually-specified PK isn't super common but it does happen and should be supported one way or another.

@AnirvanB
Copy link

Upvoting.

@nexy7574
Copy link

according to #143, this was intentional

@roks0n
Copy link

roks0n commented May 16, 2023

I agree, you can have a primary key index on a column that doesn't have AUTO_INCREMENT set. An ability to allow setting the value in such cases is mandatory, otherwise there's no way to create that entry via ORM.

Given this comment:

if you find maybe Django or SQLAlchemy have a different behaviour, we could change it.

I can confirm that Django's ORM allows settings a value for a primary_key column at creation time (I'm using that in one of my applications).

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

4 participants