ship-hold-uuids

1.0.1 • Public • Published

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)
 
 

Package Sidebar

Install

npm i ship-hold-uuids

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • lorenzofox3