prorm API Reference
    Preparing search index...

    Function SecureField

    TypeScript Decorators / Annotations for ts-prorm-orm

    Exports all decorator utilities organized by category:

    Encryption —

    /

    for password hashing Procedures —

    /

    for stored procedures & SQL functions Views —

    for mapping a Model class to a database view Permissions —

    /

    /

    /

    /

    • Mark a model field so its value is automatically hashed before INSERT/UPDATE.

      This is a class decorator factory — pass the field name(s):

        @SecureField('password')
      @SecureField('pin', { algorithm: 'bcrypt', adapter: myAdapter })
      class User extends Model { ... }

      The ORM will call hashSecureFields(instance) in a beforeCreate / beforeUpdate hook to encrypt the field before it reaches the database.

      Parameters

      Returns (target: Function) => void