Skip to content

Releases: faisaltheparttimecoder/mock-data

v2.0 - February 2020

23 Feb 15:51
0fa8255

Choose a tag to compare

  • Complete refactor of the code
  • Allow the option to create x amount of tables
  • Create a quick small demo database
  • Customise loading of data into the tables and also give user control to use it
  • etc

v1.1 - October 2017

30 Oct 11:54

Choose a tag to compare

Change log

  • Whats New
    • MockD now supports and generate random data on array datatypes.
    • MockD now attempts to fix constraints of the composite primary key (PK) or unique key (UK) by taking all the columns involved.
    • MockD now generate actual bytea data.
    • MockD now has debug information while creating constraints, it prints what command is being executed and if it was successful in creating it or not.
  • Bugs fixes
    • MockD crashes when no flags are set, this is now fixed.
    • MockD earlier used to prints all debug information on the screen, this has been cleaned up and debug information will only be printed when used with "debug" flag.
    • Better handling of constraint errors, earlier we used to exit the program as soon as we hit the error during constraint creation, leaving other constraints unattended. This fix ensures we at least attempt to recreate all of them, if we do receive the error we show it on the screen and ask for user interaction to recreate the missing constraint.

v1.0 - July 2017

19 Jul 09:58

Choose a tag to compare

Command Reference

./mockd-mac postgres -help
2017-07-16 10:58:43.609:INFO > Parsing all the command line arguments
Usage of postgres:
  -d string
    	The database name where the table resides (default "postgres")
  -h string
    	The hostname that can be used to connect to the database (default "localhost")
  -i	Ignore checking and fixing constraint issues
  -n int
    	The total number of mocked rows that is needed (default 1)
  -p int
    	The port that is used by the database engine (default 5432)
  -t string
    	The table name to be filled in with mock data
  -u string
    	The username that can be used to connect to the database (default "postgres")
  -w string
    	The password for the user that can be used to connect to the database
  -x	Mock all the tables in the database

Examples

  • Mock one table will random data
bin/mockd-mac <dbengine> -n <total rows> -u <user> -d <database> -t <table>
  • Mock multiple table with random data
bin/mockd-mac <dbengine> -n <total rows> -u <user> -d <database> -t <table1>,<table2>,....
  • Mock entire database
bin/mockd-mac <dbengine> -n <total rows> -u <user> -d <database> -x

Known Issues

  1. When using a small amount of rows and having defined a composite PK index, there are chances that the primary key would fail (this is due to foreign key fix only runs after primary key fix)
  2. Still having issues with Check constraint, only check that works is "COLUMN > 0"
  3. On Greenplum Datbase/HAWQ partition tables are not supported (due to check constraint issues defined above)
  4. Custom datatypes are not supported