Skip to main content

QFakerFieldSpec

@quik/faker


@quik/faker / QFakerFieldSpec

Type Alias: QFakerFieldSpec

QFakerFieldSpec = object

Defined in: faker/src/spec/QFakerSpec.ts:8

Configuration for a single field within a faker model spec.

Properties

args?

optional args?: unknown[]

Defined in: faker/src/spec/QFakerSpec.ts:19

Positional arguments to pass to the faker method as-is. E.g. [{ "min": 1, "max": 100 }] is spread as faker.number.int({ min: 1, max: 100 }).


generator?

optional generator?: string

Defined in: faker/src/spec/QFakerSpec.ts:13

Dot-path into the faker API to call. E.g. "person.fullName", "internet.email". Mutually exclusive with skip.


nullable?

optional nullable?: boolean

Defined in: faker/src/spec/QFakerSpec.ts:36

When true the field may be randomly set to null. Requires the DB column to be nullable.


nullRate?

optional nullRate?: number

Defined in: faker/src/spec/QFakerSpec.ts:41

Probability (0-1) that a nullable field receives null. Defaults to 0.1.


skip?

optional skip?: boolean

Defined in: faker/src/spec/QFakerSpec.ts:25

When true the field is omitted from generation and left to the DB default or preserved as-is (anonymize mode). Use this for PKs, FK columns, and auto-timestamps.


unique?

optional unique?: boolean

Defined in: faker/src/spec/QFakerSpec.ts:31

Ensure generated values are unique across the batch. Only honoured in generate mode. Up to 100 retries are attempted before throwing.