Recently, as part of my job, I had to test some code against thousands of tables. Of course, I didn’t want to create them manually. Before delving into further research, I thought, why not ask ChatGPT first to help me with this? So, I asked ChatGPT to create a NodeJS module for generating 10k tables in a MariaDB database. Surprisingly, it did a pretty good job. I made some minor tweaks to the code, and it worked like a charm. Now, I’m going to share that code.
I created a folder named
create-tables and within it, I added two files:
index.js file contains the code for table creation, while the
package.json file contains the dependencies for the project.
To use this code, you need to install the dependencies first. To do so, open the terminal and navigate to the folder where you created the files. Then run the command:
npm install. This will install all the dependencies. Finally, run the command:
npm start. It will start creating the tables. Once the process is complete, you can check the database to see if all the tables have been created or not.