db-model-proxy
v0.0.1
Published
A safe way to get db models' table name and fields
Downloads
1
Readme
model-proxy
A safe way to get database models' table name or fields
installation
$ npm i model-proxy
quick start
let $ = modelProxy({
tableA: {
field1: ...,
field2: ...
},
tableB: {
field1: ...,
field2: ...
}
})
$.tableA$ === 'tableA'
$.tableA._ === 'tableA.*'
$.tableA.field1 === 'tableA.field1'
$.inexistentTable$ // throws Error
$.tableA.inexistentField // throws Error