Hello,
I can help you without any problem. This is a very right way to change from datatables to SQL database. I have 8 years exp with Thingworx and datatables its not good way to store a large amount of information.
1. First of all please check what kind of persistence provider you have. Each DB has own TWX version.
you can find it here:

You need to select 'show system objects'

I have MYSSQL persistence provider. You can find postgree persistence provider.

I mentioned about it because if you have MYSQL persistence provider this kind of DB will be easier to connect with TWX.
Next you need to crate thing with DataBase or MYSQL Thing Template and you should choose Configuration Tab.

You should provide all information about your DB.
After when you establish connection with your DB you are able to create SQL Query and Commands (Commands are dedicate for Insert, Update,Delete)
Please don t mix SQL services with JS services inside one DB thing because it will create bottle neck with performance.
Let me know if you will have any additional questions.
Best regards
Jan