3 ms·
I have pretty much replaced my spreadsheets with postgres(sqlite would have worked as well, but... I really like postgres) simple calculations end up as views,
by somat 5y ago
I have pretty much replaced my spreadsheets with postgres(sqlite would have worked as well, but... I really like postgres) simple calculations end up as views, more complicated ones end up as an external script. a postgres function would work, but I find external scripts easier to manage.
Once, as a sort of programing kata, I wanted to see if I could turn a simple spreadsheet I found on the internet into a view.
transformer calculator: https://ludens.cl/Electron/trafos/trafos.html https://ludens.cl/Electron/trafos/trafos.html
I was successful in that I was able to put the logic in what would have been a ten line program into, well, this 150 line monstrosity.
same transformer calculator as a view: https://pastebin.com/xyDeAV7R https://pastebin.com/xyDeAV7R
Takeaway: the relational database works well to replace the spreadsheet when the spreadsheet is used as a data store, not so much when the spreadsheet is used as a programing language. but for that, the purpose built programing language is far superior.