ship-hold-uuids
v1.0.1
Published
Generate random uuids when inserting a new item whose primary key is a uuid using ship-hold data access framework
Downloads
2
Maintainers
Readme
ship-hold-uuids
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)