Direcstore

Data Modeling

Data schema presentation at runtime for table and view

Data Model

Data model is presented as object with key attributes:

  • Type: table or view
  • Name: name of data model
  • Def: definition of columns in the data model
  • selectRule: security rule will be applied when selecting data
  • insertRule: security rule will be applied when inserting data
  • updateRule: security rule will be applied when updating data
  • deleteRule: security rule will be applied when deleting data

Example data model:

        const types = require('directypes').types;
module.exports = {
    type: "table",
    name: "base",
    def: {
        id: {type: "string", pk: true},
        active: "boolean",
        createdBy: "string",
        createdOn: "string",
        updatedBy: "string",
        updatedOn: "string",
    },
    selectRule: "false",
    updateRule: "false",
    insertRule: "false",
    deleteRule: "false"
}