Finch Docs
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Generators

Integer

All integers are int64 unless otherwise noted.

int

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

ParamDefaultValid Values (v)
min1v ≥ 0
max100,000v < 264
distuniformuniform or normal
mean(max-min+1)/2
stddevmax-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)
min10 ≥ n < max
max100,000min< n < 264
p201–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)
min1int
max100,000int
size100≥ 1

Used for BETWEEN @d AND @PREV.

int-range-seq

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

ParamDefaultValid Values (n)
begin1int
end100,000int
size100≥ 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)
start00 ≤ n < 264
step1n ≥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)
len100n ≥ 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-valueyesstring-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.