I'm eveluating to move my project from `Objection....
# orm-help
s
I'm eveluating to move my project from
Objection.js
(Knex.js) to Prisma. In Objection.js I've a custom method `verifyPassword`in User Model Class to check password
Copy code
class User extends Model {
  ...
  // Compares a password to a bcrypt hash, returns whether or not the password was verified.
  async verifyPassword (password: string) {
    return await bcrypt.compare(password, this.password)
  }
  ...
}
Can I follow the same approach with Prisma or I need to create a custom function outside the model schema?
n
Hey Stefano 👋 since Prisma doesn’t follow the object-oriented paradigm and no model classes exist, the approach that you share above indeed doesn’t work but you’d indeed need to create a custom function outside the model schema in this case 👍
👍 1