Skip to content

Specifies that the field is not persistent. It is used to specify which field of your bookshelf models will not be saved on database.

License

Notifications You must be signed in to change notification settings

leonardom/bookshelf-transient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bookshelf-transient

Build Status Code Climate Test Coverage GitHub version

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 git@github.com:leonardom/bookshelf-transient.git
cd bookshelf-transient && npm install && npm test

About

Specifies that the field is not persistent. It is used to specify which field of your bookshelf models will not be saved on database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published