bookshelf-transient
v1.0.0
Published
Specifies that the field is not persistent for your bookshelf models.
Downloads
3
Readme
bookshelf-transient
Specifies that the field is not persistent. It is used to specify which field of your bookshelf models will not be saved on database.
Installation
After installing bookshelf-transient
with npm i --save bookshelf-transient
,
all you need to do is add it as a bookshelf plugin and enable it on your models.
let knex = require('knex')(require('./knexfile.js').development)
let bookshelf = require('bookshelf')(knex)
// Add the plugin
bookshelf.plugin(require('bookshelf-transient'))
// Enable it on your models
let User = bookshelf.Model.extend({ tableName: 'users', transient: [ 'password', 'confirm_password' ] })
Usage
Nothing fancy here, just keep using bookshelf as usual.
Testing
git clone [email protected]:leonardom/bookshelf-transient.git
cd bookshelf-transient && npm install && npm test