How to convert an Aggregate to a SQL element

Convert an Aggregate to a SQL element

As your application grows, you might find the need to change how data is fetched in an existing Aggregate. If you require more advanced data fetching options, consider using a SQL element instead of an Aggregate. Converting an existing Aggregate to a SQL element allows you to continue evolving the SQL generated from the original Aggregate.

However, it’s important to note that Aggregates offer several advantages:

  • Aggregates are optimised to fetch only the necessary rows and columns at runtime.
  • Maintaining an Aggregate requires less effort.

 

Therefore, it is recommended to start fetching data using an Aggregate and only switch to a SQL element when necessary.

How to convert an Aggregate to a SQL element

To convert an existing Aggregate to a SQL element, watch this tutorial from OutSystems Developer Kean Amper:

https://youtu.be/SbVJn_uLuTU

 

Want to learn more valuable Dev Tips? Sign up for our newsletter and stay updated with the latest insights! Also, don’t forget to check out our upcoming OutSystems courses to scale your career.