Welcome to sql-seed! This application helps you create realistic SQL INSERT statements from CSV files. It automatically figures out the correct data types and can handle multiple records at once. Perfect for developers wanting to seed a database with test data without any hassle.
To get started with sql-seed, follow these steps:
Visit this page to download: GitHub Releases.
Look for the most recent version. You will see files for different operating systems. Choose the one that fits your system.
Click on the appropriate file to start the download.
Once the download completes, locate the file on your computer. This is usually in your โDownloadsโ folder.
Open the file to run sql-seed.
Using sql-seed is straightforward. Follow these steps to generate your SQL INSERT statements:
Prepare your CSV file. Make sure it includes headers that match your database tableโs columns.
Open a terminal or command prompt.
Navigate to the folder where you stored the sql-seed file. You can do this by using the cd command.
Run sql-seed by entering this command in your terminal:
python sql_seed.py --file yourfile.csv --database yourdatabase
Replace yourfile.csv with the name of your CSV file and yourdatabase with the database you want to seed.
The application will analyze your CSV file and generate SQL INSERT statements.
Copy the generated SQL statements from your terminal and paste them into your database management tool to run.
When you run sql-seed, you can use the following options to customize its behavior:
--file <path>: Specify your CSV file.--database <name>: Name of the database where data will be inserted.--batch-size <number>: Set how many records are inserted at once. Default is 100.To keep sql-seed up to date, periodically check the GitHub Releases page for new versions. Follow the earlier steps to download and run newer releases.
If you encounter issues while using sql-seed, here are some common problems and solutions:
Your input is welcome! If you have ideas or improvements, feel free to submit a pull request. All contributions are appreciated.
If you need help, please reach out via the Issues section on the GitHub repository. Just describe the problem youโre facing, and weโll assist you as best we can.
Thank you for using sql-seed! Happy seeding!