Lucid ORM, the official ORM of AdonisJS, is based on knex.js. It is one of the friendlier ORMs that provides the ease of using a readable syntax along with a better performance than some of the feature-heavy ORMs.
But, I have been recently torn between using one or the other.
Consider the below query that fetches a bunch of related fields -
const statusByParSub = await Database.select("sub.sub_num", "sub.status_cd") .from("sub") .innerJoin("par", "sub.par_id", "par.id") .innerJoin("users", "par.owner_id", "users.id") .where("par.start_date", ">", queryFilter) .groupBy("sub.sub_num") .groupBy("sub.status_cd") .count(); While the above query is certainly more readable than using a SQL, I doubt whether it can achieve the same level of performance as a raw SQL. The main reasons for the thought process being the layers involved in ORM, the end-query built from 1:M and M:M relationships, and the time that I personally take in creating an efficient ORM vs. writing a raw SQL.
...