Is it better to add calculated columns in retool or using SQL

I know it's possible to add calculated columns to tables like this thread here: Populate Table Column With Calculated Value

I was wondering what people thought about just calculating the columns using SQL as you're loading the data (I'm more comfortable with SQL at this point).

Is there a benefit to doing it one way vs. the other?

I think it will really depends on how much your data changes versus changing the application front-end and the data you want to display.

I would lean toward doing it on the server vs locally. It will nearly always be more performant. Retool is a bit of a laggard, so almost anything that speeds it up is good even if it is a little more work.

Do it locally if:

  1. It will not be more performant on the server for some reason (overloaded server for instance)
  2. The value depends on some other value or state not known to the server.
  3. If you are doing updates on the table and you don't want/like the extra code required to exclude those properties from the .recordUpdates object within your bulk update query: {{ => _.omit(row, ["totals"]))}}

Thanks this is what I was thinking but you said it much more concisely than i could!