Interface GeneratorOption

Options for data to be generated.

Hierarchy

  • GeneratorOption

Properties

_tag: "GeneratorOption"
columnOptions: generator.GenColOptType

Options for each column to determine how they are generated.
The options need to be valid types for corresponding columns.

- Column -             - Option -
Numeric types -> NumericColumnOption
String types -> StringColumnOption
Datetime types -> DatetimeColumnOption
Boolean types -> BooleanColumnOption

If you want fixed values for some columns throughout entire rows,
you can specify the value using FixedValue.

columnOptionsByType: generator.ColumnOptionByTypeType

Fall back column option by each column types.

eachRow?: ((columns: ColumnsType, process: Readonly<RowProcess>, tempPrev: object) => [columns: ColumnsType, tempNext: object])

Type declaration

    • (columns: ColumnsType, process: Readonly<RowProcess>, tempPrev: object): [columns: ColumnsType, tempNext: object]
    • This callback function is called each time when rows are generated to modify generated rows.

      Example

      // Adds line number to the second column
      columns.num[1] = columns.num[1] + (process.row + 1);
      // Adds column name to begining of the fourth column
      columns.str[3] = process.names[3] + columns.str[3];
      // Returns modified columns
      return [columns,tempPrev];

      Returns

      Modified columns and the temporary information taken over to next time function call.

      Default

      undefined

      Parameters

      • columns: ColumnsType

        Columns to be modified.

      • process: Readonly<RowProcess>

        Information used for data generation process.

      • tempPrev: object

        Temporary information taken over from previous time function call.

      Returns [columns: ColumnsType, tempNext: object]

Output format. Either csv or insert statement.

size: number

The number of rows to be generated.

Default

10

Generated using TypeDoc