【文件属性】:
文件名称:objection-guid:Objection.js的自动GUID
文件大小:58KB
文件格式:ZIP
更新时间:2021-04-30 11:15:43
plugin plugins id guid objectionjs
Objection.js的自动GUID
此插件使用软件包为GUId生成向您的模型添加自动guid。
安装
NPM
npm i objection-guid
纱
yarn add objection-guid
用法
产生GUID
// Import the plugin.
const guid = require ( 'objection-guid' ) ( ) ;
const Model = require ( 'objection' ) . Model ;
// Mixin the plugin.
class Item extends guid ( Model ) {
static get tableName ( ) {
return 'Item' ;
}
}
const item = await Item . query ( ) . insert ( {
na
【文件预览】:
objection-guid-master
----.gitignore(24B)
----README.md(2KB)
----CHANGELOG.md(4KB)
----test()
--------utils()
--------index.test.js(3KB)
----.eslintrc.yml(160B)
----package.json(2KB)
----index.js(699B)
----.travis.yml(87B)
----yarn.lock(102KB)
----package-lock.json(106KB)