Application Integration - PostgreSQL Connector Select with DESC sort

  1. I have a large database with a lot of data, and I need to get the last changed row, but I only saw the sort by columns option (listEntitiesSortByColumns). How can I sort by column AND in descending order?
  2. Additionally, I want to know if it is possible to use aggregation functions (select max(), select sum() etc) for database selections.
Solved Solved
0 3 220
1 ACCEPTED SOLUTION

For 2., you can also implement the Sum or Avg as Database views or stored procedure (for more complex queries), which then offloads the processing to the DB and then the Connection will see the view in the list of Entities available.

View solution in original post

3 REPLIES 3

1.By default it sorts only by ascending order. There is no mechanism available currently to specify  sort by descending order . This is an enhancement in our roadmap. Filterclause could be an option to filter by timestamp or field values . Example usage  can be referred in link below

https://cloud.google.com/integration-connectors/docs/perform-crud-operation-mysql-database#other-ope...

2.Aggregate functions are not available in  this connector. It is in roadmap  . Data mapper   has inbuilt functions as max, sum which can be performed over an array object. 

https://cloud.google.com/application-integration/docs/data-mapping-functions-reference#size-function

For 2., you can also implement the Sum or Avg as Database views or stored procedure (for more complex queries), which then offloads the processing to the DB and then the Connection will see the view in the list of Entities available.

Thank you, I already did as you suggest