1.0.1 • Published 8 years ago

ship-hold-uuids v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

ship-hold-uuids

CircleCI

Generate random uuids when inserting a new item whose primary key is a uuid. (for ship-hold data access framework)

install

npm install ship-hold-uuids

usage

const Users = sh.model('users',function(h){
    table:'users',
    columns:{
        id:'uuid'
    }
});

Users
    .insert({name:'Laurent')
    .build();

// INSERT INTO "users" ('id','name') VALUES ('some random uuid','Laurent')


 options to pass to the factory
 
 * key: the property corresponding to the primary key (default "id")
 * generator: the id generator function (default [node-uuid](https://github.com/broofa/node-uuid) - v4)