Better HN
topnewbestaskshowjobs
Log inSign up

younepen

3 karma · joined Jun 18, 2021 (5y ago) · 1 submissions

Submissions

comment 5y ago · link · parent

>And once you have the data from the SQL database are you keeping it just in arrays/dictionaries? Or should it at least be mapped to a class structure?

Modern SQL has functions that can be used to map rows into json objects and arrays. That is what I use in nodejs/postgres. Everything is returned in the structure I want it in. The node driver turns the json into javascript arrays and objects (which then get turned back into JSON to send to the client, hah!). I added some code to the driver so that snake case field names are converted to camel case.