How to remove left join in function Knex.JS?
How to remove left join integration? await knex.select().from("dishes") .leftJoin("companies", function () { if (companyId) { this.on("dishes.companyId", "=", "companies.id") } else { // I want to remove left join if companyId is false return false; } }) I’m got an error: code: ‘ER_PARSE_ERROR’, sql: ‘select * from `dishes` left join `companies`’ } >Solution : It’s unclear… Read More How to remove left join in function Knex.JS?