npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

seed-sql

v1.0.3

Published

seed-sql is a command-line tool designed to automate the process of populating MySQL databases with realistic mock data. Unlike other data seeding tools that require extensive configuration, Seed-SQL simplifies the process by detecting the database schema

Downloads

7

Readme

seed-sql

seed-sql is a command-line tool designed to automate the process of populating MySQL databases with realistic mock data. Unlike other data seeding tools that require extensive configuration, Seed-SQL simplifies the process by detecting the database schema and foreign keys automatically, needing only the table name to generate and insert mock data. This reduces setup time and ensures the mock data is as close to real-world data as possible.

Installation

You need to install this tool globally via npm:

npm install -g seed-sql

Once installed, you can use the seed-sql commands in your project directory.

Configuration

After installing seed-sql, you must execute the seed-sql --init command in your project directory. When you run this command, a .seed-sql.config.json file will be created in your project directory with your database credentials. This file is used for connecting to your database.

The .seed-sql.config.json file contains the following keys:

gemini_api_key : Your gemini api key.

host: The host address of your database (default: localhost).

port: The port for the database (default: 3306).

username: The username for the database.

password: The password for the database.

database: The name of the database to connect to.

connectionLimit: The connection limit for the pool (default: 10)

Commands

--init : This command initializes the configuration for the database connection.

seed-sql --init

It will prompt you to enter your database details like host, username, password, and database name. This will create a .seed-sql.config.json file in your project directory.

Example of .mockgen.config.json:

{
  "gemini_api_key": "<api-key>",
  "host": "localhost",
  "port": "3306",
  "username": "root",
  "password": "<password>",
  "database": "my database",
  "connectionLimit": "10"
}

--status : Checks the status of the database connection.

 seed-sql --status

This will check if the connection to the database is successful and show whether the database is online or offline.

--tables : Fetches the list of tables from the configured database.

seed-sql --tables

This command will retrieve the list of tables from your MySQL database.

--generate : Generate mock data for the specified tables.

seed-sql --generate

This will generate realistic mock data for your tables and insert it into your MySQL database. It uses AI to ensure the generated data is unique and realistic.

The Schema and the map of foreign keys are sent to the generator function and the data is generated accordingly.

The foreign key map looks like this:

{
  fk1 : [fkVal1,fkVal2,fkVal3],
  fk2 : [fk2Val1,fk2Val2,fk2Val3]
}

Where fk1 and fk2 are the field name which are foreign keys and the array is of the value associated with them respectively.

You can add optional --prompt flag with the --generate and then add your prompt to get controlled data.

Example: seed-sql --generate --prompt "the test id in the data should be the second one the test ids in foreign key map and randomize other foregin keys value among given."

Dependencies

mysql2 : MySQL driver for Node.js.

chalk : For styling output in the terminal.

inquirer : For user prompts and interactions.

yargs : For parsing command-line arguments.

@google/genai : For generating mock data using AI (Google Gemini AI).

seed-sql is built with care to help developers quickly generate and seed mock data into MySQL databases, making development and testing easier.