Hello EspoCRM team,
I’d like to request the ability to generate a top-level SELECT EXISTS(...) query via the ORM. Currently, you can use WHERE EXISTS(…) within a query, but there’s no way to build a statement that directly returns a Boolean flag, for example:
A dedicated ORM method would allow us to:
Thank you for considering this feature!
I’d like to request the ability to generate a top-level SELECT EXISTS(...) query via the ORM. Currently, you can use WHERE EXISTS(…) within a query, but there’s no way to build a statement that directly returns a Boolean flag, for example:
Code:
SELECT EXISTS ( SELECT 1 FROM nomenclature n WHERE n.id = nc.nomenclature_id ) AS hasNomenclature FROM nomenclature_characteristic nc WHERE nc.deleted = 0;
- Return true/false directly from the database without fetching full recordsets.
- Simplify checks for related-data existence and could be more performant in many scenarios.
Thank you for considering this feature!
Comment