There are dedicated patterns for numbers, date, booleans, starting with a keyword The random generator is using patterns for setting how the generated data should look like. You can sumbit issues or pull request via github and we will try our best to fix them.Use the Data Generator to fill database tables with random data. Custom data types are not supported, use custom sub command to control the data for that custom data types.On Greenplum Database partition tables are not supported (due to check constraint issues defined above), so use the custom sub command to define the data to be inserted to the column with check constraints.Fixing CHECK constraints isn't supported due to complexity, so recreating check constraints would fail, use custom subcommand to control the data being inserted.If you have a composite unique index where one column is part of foreign key column then there are chances the constraint creation would fail.So there is no guarantee that the tool will fix all the constraints and manual intervention is needed in some cases. We do struggle when recreating constraints, even though we do try to fix the primary key, foreign key, unique key.For creating fake tables and mocking selected tables, read this section on how the subcommand tables works.For mocking the whole tables of the schema, read this section on how the subcommand schema works.For mocking the whole database or creating a demo database, read this section on how the subcommand database works.For realistic & controlled data, read this section on how the subcommand custom works.Look here on how the database connection works.Mock tables -t "public.gardens" is a simple demo of how the tool works, provide us your table and we will load the data for youįor more examples how to use the tool, please check out the wiki page for categories like You can copy the mock program to the PATH folder, so that you can use the mock from anywhere in the terminal, for eg.sĮcho alias mock=\"docker run -it -v /tmp/mock:/home/mock ghcr.io/faisaltheparttimecoder/mock-data:latest\" > ~/.zshrc Use "mock -help" for more information about a command.ĭownload the latest release for your OS & Architecture and you're ready to go! v, -verbose Enable verbose or debug logging username string Username to connect to the database r, -rows int Total rows to be faked or mocked (default 10) p, -port int Port number of the postgres database w, -password string Password for the user to connect to database i, -ignore Ignore checking and fixing constraints q, -dont-prompt Run without asking for confirmation d, -database string Database to mock the data a, -address string Hostname where the postgres database lives PLEASE DO NOT run on a mission critical databases This program generates fake data into a postgres database cluster. LOADS constraints that it had backed up (Mock-data can fail at this stage if its not able to fix the constraint violations).CHECK constraints are ignored (coming soon?).READS all the constraints information from memory.STARTS loading random data based on the columns datatype.REMOVES all the constraints on the table.STORES this constraint/unique index information in memory and also saves it to the file under $HOME/mock.CREATES a backup of all constraints (PK, UK, CK, FK ) and unique indexes (due to cascade nature of the drop constraints).BASED on sub commands i.e either database, table or schema it pull / verifies the tables.CHECKS if the database connection can be established.As Greenplum are both base from postgres, the supported postgres datatype also apply in their case.All datatypes that are listed on the postgres datatype website are supported. Supported database engines & data types Database Engine Please ensure you have a backup of your database before running Mock-data in an environment you can't afford losing. Mock-data idea is to generate fake data in new test cluster, and it is NOT TO BE USED IN PRODUCTION ENVIRONMENTS. Supported database engines & data types.However, please DO MAKE SURE TO TAKE A BACKUP of your database before you mock data in it as it has not been tested extensively.Ĭheck on the "Known Issues" section below for more information about current identified bugs. Option to select realistic data to be loaded onto the tableĪn ideal environment to make Mock-data work without any errors would be.Create n number of table with n number of column.It's only needed to provide the target table(s), and the number of rows of randomly generated data to insert. Their own tables defined with any particular (supported) data types.The idea behind it is to allow users to test database queries with sets of fake data in any pre-defined table. Mock-data is the result of a Pivotal internal hackathon in July 2017.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |