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. Choices are MySQL, SQLite, Oracle, or PostgreSQL.
Only tables which are specified this option are processed.
Tables which are specified this option are ignored(--include and --exclude options are exclusively used).
Output file.
Output format. Choices are SQL or JSON.
Print output prettily.
The maximum bytes of bulk insert statement.
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.