I am building a plugin for Wordpress that uses Ag-Grid as a UI to manipulate a data table. The user would be creating several (maybe dozens, hundreds?) of different tables, so storing them each as their own sql table isn’t feasible.
I suppose at this point I’m left with storing the data either as JSON or strings that represent a csvs.
The prototype I’ve built uses JSON like
[
{
"Department":"Sheriff",
"Budget":100000,
"MeetAt":"2025-01-26T14:30:00Z",
"preferredColor":"red",
"PostContent":"<div> </div>"
},
{
"Department":"Assessor",
"Budget":20000,
"MeetAt":"2025-01-26T14:30:00Z",
"preferredColor":"#232323",
"PostContent":"<div> </div>"
},
{
"Department":"Treasurer",
"Budget":30000,
"MeetAt":"2025-01-26T14:30:00Z",
"preferredColor":"#E72323",
"PostContent":"<div> </div>"
}
]
where each of the keys in the objects represents a column in the table (which means each object represents a row).
CSV strings kind of make more sense to my brain, but I suspect that that would lead mean it would be easier to screw up the integrity of the data.
What’s the typical way of working with tabular data in javascript?