db-model-proxy

0.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i db-model-proxy

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

61.4 kB

Total Files

7

Last publish

Collaborators

  • xiechao06