datagen_from_ddl - Dummy data generator from DDL statements
$ datagen_from_ddl [options] your_ddl.sql $ datagen_from_ddl --num=users:10,100 --include=users,blogs --format=sql --pretty your_ddl.sql
datagen_from_ddl generates dummy records and output them to STDOUT in default so that it can pipe to RDBMS client.
$ datagen_from_ddl --num=100 your_ddl.sql | mysql -u user -p DBNAME
Number of records generated.
Example:
--num=20 (20 records for all tables) --num=users:10,100 (10 records for users and 100 records for other tables)
Parser for DDL. Parser can be 'MySQL', 'SQLite', 'Oracle', or 'PostgreSQL'.
Only tables specified by this option are processed.
Tables which are specified this option are ignored(--include and --exclude options are exclusively specified).
Output file.
Output format. Format can be 'SQL' or 'JSON'.
Pretty print.
The maximum bytes of bulk insert statement.
You can specify this option value like '64', '1MB', '10M'.
This option is releated to the MySQL's 'max_allowed_packet' variable which stands for the maximum size of string. It's recommended to suit this option for your MySQL settings.
cf. https://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_max_allowed_packet
To install Data::Generator::FromDDL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Generator::FromDDL
CPAN shell
perl -MCPAN -e shell install Data::Generator::FromDDL
For more information on module installation, please visit the detailed CPAN module installation guide.