Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zorro-del-caribe/ship-hold-uuids
Generate random uuids when inserting a new item whose primary key is a uuid using ship-hold data access framework
https://github.com/zorro-del-caribe/ship-hold-uuids
Last synced: about 1 month ago
JSON representation
Generate random uuids when inserting a new item whose primary key is a uuid using ship-hold data access framework
- Host: GitHub
- URL: https://github.com/zorro-del-caribe/ship-hold-uuids
- Owner: zorro-del-caribe
- License: mit
- Created: 2016-07-28T09:26:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-23T07:54:12.000Z (about 8 years ago)
- Last Synced: 2024-10-12T23:08:38.376Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ship-hold-uuids
[![CircleCI](https://circleci.com/gh/zorro-del-caribe/ship-hold-uuids.svg?style=svg)](https://circleci.com/gh/zorro-del-caribe/ship-hold-uuids)
Generate random uuids when inserting a new item whose primary key is a uuid. (for [ship-hold](https://gihtub.com/gh/zorro-del-caribe/ship-hold) data access framework)
## install
``npm install ship-hold-uuids``
## usage
```javascript
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)