Skip to content

Latest commit

 

History

History
117 lines (85 loc) · 3.55 KB

usage.md

File metadata and controls

117 lines (85 loc) · 3.55 KB

Usage

common

usage: slicedb [-h] [--log-level {error,info,debug,trace}] [-v]
               {dump,restore,schema,schema-filter,transform,transform-field} ...

Capture, scrub, and restore subsets of PostgreSQL databases.

optional arguments:
  -h, --help                                                     Show this help message and exit.
  --log-level {error,info,debug,trace}                           Log level (default: info).
  -v, --version                                                  Show version and exit.

subcommands:
  Provide one of the subcommands for more specific help.

  {dump,restore,schema,schema-filter,transform,transform-field}

dump

usage: slicedb dump [-h] [--include-schema] [-j JOBS] [-o OUTPUT] [--output-type {slice,sql}]
                    [--pepper PEPPER] [--transform TRANSFORM] [-r TABLE CONDITION] -s SCHEMA

Dump data from database.

optional arguments:
  -h, --help                                  Show this help message and exit.
  --include-schema, --no-include-schema       Whether to include schema. Only compatible with SQL
                                              output.
  -j JOBS, --jobs JOBS                        Number of workers (default: 1).
  -o OUTPUT, --output OUTPUT                  Path to output slice, or - for stdout (default: -).
  --output-type {slice,sql}                   Output type.
  --pepper PEPPER                             Pepper to use for transform. Autogenerated if not
                                              provided.
  --transform TRANSFORM                       Path to transform config, or - for stdin
  -r TABLE CONDITION, --root TABLE CONDITION  The ID of the root table and SQL condition. May be
                                              repeated.

required arguments:
  -s SCHEMA, --schema SCHEMA                  Path to schema, or - for stdin.

restore

usage: slicedb restore [-h] [--disable-triggers] [-j JOBS] [-i INPUT] [--transaction]

Restore data.

optional arguments:
  -h, --help                                 Show this help message and exit.
  --disable-triggers, --no-disable-triggers  Disable triggers, including foreign keys.
  -j JOBS, --jobs JOBS                       Number of workers (default: 1). Using more than one
                                             worker requires disabling transactions.
  -i INPUT, --input INPUT                    Path to slice, or - for stdin (default: -).
  --transaction, --no-transaction            Whether to run in a single transaction (default: True).

schema

usage: slicedb schema [-h] [-o OUTPUT]

Collect schema from database.

optional arguments:
  -h, --help                  Show this help message and exit.
  -o OUTPUT, --output OUTPUT  Path to output schema, or - for stdout (default: -).

schema-filter

usage: slicedb schema-filter [-h] [-i INPUT] [-o OUTPUT] {children} ...

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input
  -o OUTPUT, --output OUTPUT
                        Output

subcommands:
  {children}

transform

usage: slicedb transform [-h] --transform TRANSFORM

Transform slice

optional arguments:
  -h, --help             Show this help message and exit.
  --transform TRANSFORM

transform-field

usage: slicedb transform-field [-h] [--pepper PEPPER] --transform TRANSFORM field

Transform field

positional arguments:
  field

optional arguments:
  -h, --help             Show this help message and exit.
  --pepper PEPPER        Pepper.
  --transform TRANSFORM