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
format
should be called for select
, delete
, and first
queries
#26
Comments
First makes sense, since that's based off the model attr's... what would the format be used on with the |
Delete would be the same if using something other than id. |
Currently
But I could probably change it so that if you tried to delete a model and didn't have an |
Probably quite a rare case but sounds good. Just clarifying from my last post, the main issue is select queries not running
This complicates things like |
Right... I'll change it to use format in the |
...just realised what you meant - I didn't read that as the method Makes sense now. |
Decided not to make the change on the delete... The reasoning that it shouldn't be easy to delete models if you accidentally left of the model.query('where', {some: 'value'}).del(...` The |
From the docs an example of
format
is to be able to underscorize camel cased attrs before working with the db.However, format is only run on insert and update. Format should be run for all sync methods.
Use Case
I use camel cased variables all through my code base, but I prefer to use underscores in my database because with Postgres, identifiers with capitalizations must be quoted which is irritating when sending raw queries to the db (e.g. when using
psql
on the command line).The text was updated successfully, but these errors were encountered: