0.0.1 • Published 5 years ago

db-model-proxy v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

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