![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
bookshelf-uuid-column
Advanced tools
Automatically generates UUID for your models in a custom column
Automatically generate UUIDs for your models and let you choose the column name.
Useful if you are using standard integer primary keys but prefer not to expose these to the public, rather identifying your resources based on an unique ID.
After installing bookshelf-uuid-column
with npm i --save bookshelf-uuid-column
,
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-uuid-column'))
// Enable it on your models
let User = bookshelf.Model.extend({ tableName: 'users', uuid: true, uuidAttribute: 'uuid' }) // default uuidAttribute is 'uuid'
Nothing fancy here, just keep using bookshelf as usual.
// This user is indestructible
let user = yield User.forge({ email: 'foo@bar' }).save()
console.log(user.id) // 6b7a192f-6e1c-4dcb-8e57-14ab16d5fdf4
bookshelf-uuid-column
generates UUIDs v4 by default, but you can easily switch to
v1 UUIDs or a custom generator.
bookshelf.plugin(require('bookshelf-uuid-column'), {
type: 'v1' // Or your own function
})
git clone git@github.com:jesobreira/bookshelf-uuid-column.git
cd bookshelf-uuid-column && npm install && npm test
FAQs
Automatically generates UUID for your models in a custom column
We found that bookshelf-uuid-column demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.