Storing tables in sql database or anywhere else.

I am working on a mod that requires entities to be saved on map change (along with their values such as variables asigned to them).
I know how to make it work properly, but I don’t have a clue how or where to save such table.

At first I was planning on making a table of items, then only saving their class and using that table to reasign some variables to the entities (such as models), but then I realised that it has to store stuff like it’s position, angles etc.

So right now I am clueless, so any help will be most appreciated!

Easiest way is to just make a .txt file and use the JSON to table and table to JSON functions.