Skip to content

hyc3z/AddSql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AddSql

A tool for mysql database testing.

This simple script can generate random data based on the Datatypes defined in config.json. You can also set certain percentage of the data to (NULL).

Edit the settings in config/config.json to make it work.

json format: 'addsql.png'

tableConfig

settings for creating a new table,like

"tableConfig": {
                "database": "testdb",
                "dropIfExists": false,
                "charset": "utf8mb4",
                "engine": "innodb",
                "comment": "test",
                "generateCount": 1
            },
  • "generateCount":100
    Insert 100 new records into the table containing generated data.
dataSetup

data attributes, for example:

"dataSetup": {
                        "dataType": "int",
                        "length/set": "10",
                        "unsigned": true,
                        "allowNull": false,
                        "zerofill": false,
                        "hasDefault": false,
                        "comment": "id"
                    },
dataGenerator

settings for data generator that generates random data.

"dataGenerator": {
                        "fillType": "random",
                        "nullPercentage": 0
                    }
  • "fillType":"random"
    The generator will generate random data based on the defined dataType.
  • "fillType":"selective"
    The generator will randomly choose data from list-type "fillEnum" defined in "dataGenerator".

If the dataType of this column belongs to Text category, like "VARCHAR" , you may also add following options in the "dataGenerator" segment:

  • "fillChar":"all"
    The filled characters are randomly picked ASCII characters.

  • "fillChar":"lowercase"
    The filled characters are randomly picked lowercase ASCII characters.

  • "fillChar":"uppercase"
    The filled characters are randomly picked uppercase ASCII characters.

  • "fillChar":"numeric"
    The filled characters are randomly picked numeric ASCII characters.

  • "fillChar":"alphanumeric"
    The filled characters are randomly picked alphanumeric ASCII characters.

Currently supported datatypes: TINYINT,SMALLINT,MEDIUMINT,INT,BIGINT,BIT,FLOAT,DOUBLE,VARCHAR.

TODO: Editor,dump sql to

About

A tool for database testing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published