-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Insert causes error when no id
field defined.
#18
Comments
For the time being, the fix for this is to add |
Yeh looks good. I'd just mention that the sequelize library uses the 2nd parameter of its |
Yeah, that'd fall more under Bookshelf... I had added whitelist/blacklist attributes in there for mass assignment, but then I decided to remove them and leave that up to the user to implement. It's really easy to add the kitchen sink when it comes to validations/assignment and they can get pretty complex, so I'm going to try to keep it bare bones for now and focus mostly on doing a good job with relations (just added polymorphic associations btw). I'll try to get to this |
Just got bitten with this one too. In my case my table doesn't even have a single 'id' field (there's a compound key). The assumption of an 'id' field seems to be pervasive in Knex/Bookshelf, but maybe that's okay. I like your idea of a "returning" option - my expectation would be that it would be off by default. |
The text was updated successfully, but these errors were encountered: