Skip to content

Bookshelf plugin for handling the conversion between the database's snake_cased and a model's camelCased properties automatically.

License

Notifications You must be signed in to change notification settings

bookshelf/case-converter-plugin

Repository files navigation

Bookshelf Case Converter Plugin

Build Status Greenkeeper badge

This is a plugin for the Bookshelf Node.js ORM that handles the conversion between the database's snake_cased and a model's camelCased properties automatically.

How to use

First install the package:

npm install bookshelf-case-converter-plugin

Then load the plugin using bookshelf.plugin('bookshelf-case-converter-plugin'). No further action is required, since the plugin will automatically convert model attributes between snake_case and camelCase.

Limitations

Note that there are some limitations to the way this plugin works. When you access query methods directly, there will be no conversion, meaning that you have to use the actual database column names in this case. The following methods do no work with this plugin yet:

About

Bookshelf plugin for handling the conversion between the database's snake_cased and a model's camelCased properties automatically.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published