Skip to content

Sub command: Schema

Faisal Ali edited this page Feb 23, 2020 · 4 revisions

Introduction

The schema sub command is used to mock the data at schema level.

Short Hand: The short hand of the schema subcommand is s

Usage

The usage of table subcommand is

[gpadmin@gpdb-m ~]$ mock schema --help
Mock all the table under the schema

Usage:
  mock schema [flags]

Aliases:
  schema, s

Flags:
  -h, --help                 help for schema
  -n, --schema-name string   Provide the schema name whose tables need to be mocked

Global Flags:
  -a, --address string    Hostname where the postgres database lives
  -d, --database string   Database to mock the data (default "gpadmin")
  -q, --dont-prompt       Run without asking for confirmation
  -i, --ignore            Ignore checking and fixing constraints
  -w, --password string   Password for the user to connect to database
  -p, --port int          Port number of the postgres database (default 3000)
  -r, --rows int          Total rows to be faked or mocked (default 10)
  -u, --username string   Username to connect to the database
  -v, --verbose           Enable verbose or debug logging

Example

  • To fake on all the tables of a schema
    mock schema --schema-name <schema-name>
    -- OR --
    mock s -n <schema-name>
    
    schema-mocker NOTE: You can only mock on schema at a time, multiple schema is not supported ATM.
  • To fake on all the tables of a schema and insert let say 100 rows
    mock schema --schema-name <schema-name> --rows 100
    -- OR --
    mock s -n <schema-name> -r 100
    
Clone this wiki locally