Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
module.exports = {
  useSQL: true,
  dbObject: "product",


  overrides: {
    prcatid: {
      type: "decimal",
      length:5,
      decimals:0,
      transformToDbdbTransforms: {
        toDb: function(value) { return value.toString().padStart(5,"0") },
      transformFromDb  fromDb: function(value) { return Number(value) },
      }
    },
    prtime: {
      type: "time",
      transformToDbdbTransforms: {
        toDb: profound.utils.timeToCharTransform,
      transformFromDb  fromDb: profound.utils.charToTimeTransform
      }
    },
    prdesc: {
       varying: false
    }
  }
}


Once this module file is created, all pjs programs that do a pjs.defineTable(...) will then use and SQL interface to access the data.

...