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
Updating a model with a composite primary key #720
Comments
I'm having the same problem. |
Unfortunately bookshelf does currently not support composite keys.
You'll have to use a I'm going to close this as a duplicate as this issue is being tracked in #93. |
I am also trying to save/update a table that has composite keys. since bookshelf doesn't support composite keys, should we just get rid of composite key completely and use another ORM? What is a workaround? Can you provide an example of using the |
@kichingxx just use where clause like:
However, compose keys should be a bookshelf feature... |
Has this changed in the past ~2 years? |
I have a model that is set up to have a composite primary key:
When using bookshelf, I have a User model with a function 'add' that will add the user or update the user if they already exist. I'm doing something like:
The code above, as written, yields an error of
Is there a way to save/update the user with a composite key by just doing 'save' or do I need to include the 'where' clause as well?
The text was updated successfully, but these errors were encountered: