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

Primary key setting with partial information and then saving #178

Open
Jaymon opened this issue Mar 22, 2024 · 0 comments
Open

Primary key setting with partial information and then saving #178

Jaymon opened this issue Mar 22, 2024 · 0 comments
Labels

Comments

@Jaymon
Copy link
Owner

Jaymon commented Mar 22, 2024

This is something I need to check on to see what prom does, say I do something like this:

f = Foo(pk="<UUID>", bar="some value")
await f.save()

What does that do if there is already a row with a matching pk? Let's say Foo had 6 fields, does it blow those out with None or default values?

I think it should look at the primary key field and decide if it is a key that can be set, if it isn't it (ie it's an auto-set UUID or counting field) then it should treat the pk as belonging to an existing row and set the appropriate plumbing to do an update when .save() is called.

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

No branches or pull requests

1 participant