If the number of data points written to the database does not match the initial number created, the database will throw an error and data will be lost, potentially large amounts.
Create a new database if the old database throws an error to preserve data.
Or create new tables with different names if the number of peaks change, directly in the loop, every time data is written. This will check if the number of peaks has changed from a simple variable and call a function to create a new table if true.
If the number of data points written to the database does not match the initial number created, the database will throw an error and data will be lost, potentially large amounts.
Create a new database if the old database throws an error to preserve data.
Or create new tables with different names if the number of peaks change, directly in the loop, every time data is written. This will check if the number of peaks has changed from a simple variable and call a function to create a new table if true.