{"id":22235177,"url":"https://github.com/ponyo877/dummy_data_generator","last_synced_at":"2025-07-27T21:32:40.804Z","repository":{"id":198860321,"uuid":"701594816","full_name":"ponyo877/dummy_data_generator","owner":"ponyo877","description":":zap: dummy data generator for development :zap:","archived":false,"fork":false,"pushed_at":"2024-04-21T07:38:20.000Z","size":59,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-21T09:03:05.379Z","etag":null,"topics":["dummy-data-generator"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ponyo877.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-10-07T02:29:47.000Z","updated_at":"2024-04-21T07:38:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb81594b-d531-4d1c-a540-0278b1f8c237","html_url":"https://github.com/ponyo877/dummy_data_generator","commit_stats":null,"previous_names":["ponyo877/dummy_data_generator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyo877%2Fdummy_data_generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyo877%2Fdummy_data_generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyo877%2Fdummy_data_generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ponyo877%2Fdummy_data_generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ponyo877","download_url":"https://codeload.github.com/ponyo877/dummy_data_generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227836982,"owners_count":17827066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dummy-data-generator"],"created_at":"2024-12-03T02:12:22.775Z","updated_at":"2024-12-03T02:12:23.427Z","avatar_url":"https://github.com/ponyo877.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dummy Data Generator CLI\nThis CLI tool allows you to efficiently generate a large amount of dummy data in a database. It supports both PostgreSQL and MySQL and provides a flexible configuration file to specify which tables and columns to populate.\n\n## Installation\nTo install the CLI tool, run the following command:\n\n```bash\ngo install github.com/ponyo877/dummy_data_generator\n```\n\n## Features\n- Generate a substantial amount of dummy data in a database.\n- Supports both PostgreSQL and MySQL.\n- Customize data generation through a configuration file.\n- Track progress with a visual progress bar.\n\n# Configuration\n| Field       | Description                                                               |\n|-------------|---------------------------------------------------------------------------|\n| tablename   | Name of the table where the data will be generated.                        |\n| recordcount | Total number of records to be generated.                                   |\n| buffer      | Buffer size for generating records (useful for optimizing performance).    |\n| columns     | List of columns with their respective configurations.                       |\n| columns[].name        | Name of the column.                                                        |\n| columns[].type        | Data type of the column (e.g., number, varchar, timestamp).                  |\n| columns[].rule        | Generation rule for the column.                                             |\n| columns[].rule.type        | Dummy rule type (e.g., unique, const, pattern, random) |\n| columns[].rule.format        | [type: unique only] Dummy data format (e.g., UUID(varchar), ULID(varchar), NOW(timestamp)) |\n| columns[].rule.value        | [type: const only] Dummy data const value |\n| columns[].rule.min        | start of sequential value |\n| columns[].rule.max        | [type: pattern only] end of sequential value |\n| columns[].rule.min_time   | [type: random (timestamp) only] minimum value for random timestamp |\n| columns[].rule.max_time   | [type: random (timestamp) only] maximum value for random timestamp |\n| columns[].patterns[].value        | [type: pattern only] repeated value |\n| columns[].patterns[].times        | [type: pattern only] value of how many times to repeat |\n\n#### Example Rules:\n\n- `type: unique`: Generates unique values. sequential number(default), current_timestamp(format: NOW), UUID and ULID is supported\n- `type: const`: Assigns a constant value.\n- `type: pattern`: Generates values based on specified patterns. If you specify [{value: A, times: 2}, {value: B, times: 1}], it will create repeated values like [A,A,B,A,A,B,...] and so on. And if you specify {Min: 1, Max: 5}, it will create repeated values like [1,2,3,4,5,1,2,3,...] and so on.\n- `type: random`: Generates random values between two values; min_time and max_time. Only timestamp data type is available as of now. If you specify {min_time: '2024-01-01 00:00:00', max_time: '2024-03-31 23:59:59'}, it will yeild random timestamps between them like '2024-02-01 01:23:45' but not '2023-12-31 23:59:59' or '2024-04-01 00:00:00'.\n\n##### Example\n```yaml\ntablename: sample_tbl\nrecordcount: 1000000\nbuffer: 1000\ncolumns:\n# The 'id' column is a string in ULID format, ensuring all values are unique.\n- name: id\n  type: varchar\n  rule:\n    type: unique\n    format: ULID\n# The 'sex' column will contain the strings \"male\", \"female\", and \"NA\" in a 3:2:1 ratio.\n- name: sex\n  type: varchar\n  rule:\n    type: pattern\n    patterns:\n    - value: male\n      times: 3\n    - value: female\n      times: 2\n    - value: NA\n      times: 1\n# The 'created_at' column will have the fixed value \"2024-01-01 00:00:00\".\n- name: created_at\n  type: timestamp\n  rule:\n    type: const\n    value: '2024-01-01 00:00:00'\n```\n## Sub Command\n| Sub Command           | Description                                                                                                  |\n|------------------|--------------------------------------------------------------------------------------------------------------|\n| dummy_data_generator cnt     | show number of record |\n| dummy_data_generator gen     | generate dummy data |\n\n## Option\n| Option           | Description                                                                                                  | Default Value |\n|------------------|--------------------------------------------------------------------------------------------------------------|---------------|\n| -c, --config      | configuration file for dummy data. You can provide multiple configuration files using wildcards \u003cbr\u003e(e.g., `-c \"cfg_*.yaml\"`) or by comma-separating them (e.g., `-c cfg_1.yaml,cfg_2.yaml`). | `config.yaml` |\n| -d, --database    | name of the database to use.                                                                   | `mydb`        |\n| -u, --dbuser      | database user name.                                                                            | `root`        |\n| -e, --engine      | database engine to use. Supports `postgres` and `mysql`.                                     | `postgres`    |\n| -h, --host        | database server host or socket directory.                                                      | `127.0.0.1`   |\n| -p, --password    | database password to use when connecting to the server.                                       | `password`    |\n| -P, --port        | database server port.                                                                         | `5432`        |\n\n## Usage Examples\n- Example 1: Check current number of records. (MySQL)\n```bash\n$ dummy_data_generator cnt -e mysql -h 127.0.0.1 -u root -P 5432 -p password -c sample_1.yaml,sample_2.yaml\n+--------+-------+\n| TABLE  | COUNT |\n+--------+-------+\n| table1 |     0 |\n| table2 |     0 |\n+--------+-------+\n```\n\n- Example 2: Generate dummy data to target table designated config file. (PostgreSQL, all default value without config)\n```bash\n$ dummy_data_generator gen -c \"sample_*.yaml\"\ntable1: 534000 / 1000000 in progress  [=====================\u003e-------------------]  53 %\ntable2: 533000 / 1000000 in progress  [=====================\u003e-------------------]  53 %\ntable3:    10000 / 10000 done!       [=========================================] \n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fponyo877%2Fdummy_data_generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fponyo877%2Fdummy_data_generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fponyo877%2Fdummy_data_generator/lists"}