Skip to content


Subversion checkout URL

You can clone with
Download ZIP


MySQL column name that starts with "style_" cannot be read from DB #545

JohnPostlethwait opened this Issue · 4 comments

2 participants


I am building an application on an existing MySQL database.

One of the column names was "style_id". When I set up my model, all the properties were read out of the database just fine, except for this one named "style_id" which was always "undefined".

Doing SELECT * FROM fabrics; directly in MySQL would show me the style_id property just fine. Doing a simple geddy.model.Fabric.all( ... ); would never have a style_id that was not undefined.

When I changed "style_id" to "style_identifier" in my MySQL database, I would get the same "undefined" result. When I changed the column name to "identifier" all of a sudden it started selecting the value out of the database without any issue.

It seems it was the "style_" prefix it didn't like...


Model automatically converts properties in 'snake case' (i.e., lowercase, underscores) to camel case. These will still be in snake case in the database columns. You can turn this feature off by setting forceCamel to false in the model config.


Something like this?

var MyModel = function () {
    this.forceCamel = false;

    // ...

It's global to the model lib, so just model.forceCamel.


Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.