Finch Docs

# Generators

## Integer

All integers are `int64` unless otherwise noted.

### int

Random integer between `[min, max]` with uniform or normal distribution

ParamDefaultValid Values (v)
`min`1v ≥ 0
`max`100,000v < 264
`dist``uniform``uniform` or `normal`
`mean`(max-min+1)/2
`stddev`max-min/8.0

If `dist = normal`, you can shift/scale the distribution by tweaking `mean` and `stddev`.

### int-gaps

`p` percentage of integers between `[min, max]` with uniform random access

ParamDefaultValid Values (n)
`min`10 ≥ n < `max`
`max`100,000`min`< n < 264
`p`201–100 (percentage)

Used to access a fraction of data with intentional gaps between accessed records.

### int-range

Random ordered pairs `{n, n+size-1}` where `n` between `[min, max]` with uniform distribution

ParamDefaultValid Values (n)
`min`1int
`max`100,000int
`size`100≥ 1

Used for `BETWEEN @d AND @PREV`.

### int-range-seq

Sequential ordered pairs `{n, n+size-1}` from `begin` to `end`

ParamDefaultValid Values (n)
`begin`1int
`end`100,000int
`size`100≥ 1

Used to scan a table or index in order by a range of values: [1, 10], [11, 20]. When `end` is reached, restarts from `begin`.

### auto-inc

Monotonically increasing uint64 counter from `start` by `step` increments

ParamDefaultValid Value (n)
`start`00 ≤ n < 264
`step`1n ≥1

Every call adds `step` then returns the value. By default starting at zero, returns 1, 2, 3, etc. If `start = 10`, returns 11, 12, 13, etc. If `start = 100` and `step = 5`, returns 105, 110, 115, etc.

## String

### str-fill-az

Fixed-length string filled with random characters a-z and A-Z

ParamDefaultValid Value (n)
`len`100n ≥ 1

String length `len` is characters, not bytes.

## ID

### xid

Returns rs/xid values as strings.

## Column

The `column` generator is used for SQL modifiers `save-insert-id` and `save-result`

ParamDefaultValid Value
`quote-value`yesstring-bool

The `quote-value` param determines if the value is quoted or not when used as output to a SQL statement:

• yes → `WHERE id = "%v"`
• no → `WHERE id = %v`

The underlying MySQL column type does not matter because the value is not cast to a data type; it’s inputted and outputted as raw bytes.

The default data scope for column data is trx, not statement. This can be changed with an explicit scope configuration. Iter data scope might be useful, but statement (or value) scope will probably not work since the purpose is to resue the value in another statment.