prorm API Reference
    Preparing search index...

    Variable SecureConst

    Secure: (field: string, options?: SecureOptions) => (target: Function) => void = SecureField

    Alias for SecureField — preferred shorthand.

      @Secure('password')
    class User extends Model { ... }

    Type Declaration

      • (field: string, options?: SecureOptions): (target: Function) => void
      • 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