-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdatafaker-types.example.yaml
More file actions
30 lines (27 loc) · 1.66 KB
/
Copy pathdatafaker-types.example.yaml
File metadata and controls
30 lines (27 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Custom Datafaker types for SeedStream.
#
# Datafaker exposes far more providers than SeedStream pre-registers. Map a SeedStream type key to
# a Datafaker method path (each dot-separated segment is a no-arg method, invoked left to right
# starting on the Faker instance). The chain is validated at load time, so a typo fails fast.
#
# Use with: ./seedstream inspect schema.sql --faker-types config/datafaker-types.example.yaml
# and: ./seedstream execute --job ... --faker-types config/datafaker-types.example.yaml
#
# Once registered, a structure can reference the key directly, e.g. datatype: beer_style
# The inspector also auto-targets a custom type when a column name matches its key.
types:
beer_style: beer.style # faker.beer().style()
beer_name: beer.name # faker.beer().name()
pokemon: pokemon.name # faker.pokemon().name()
full_address: address.fullAddress # faker.address().fullAddress()
job_title: job.title # faker.job().title()
company_industry: company.industry # faker.company().industry()
# A `regex:`-prefixed value generates strings matching the regex after `regex:` (via RgxGen, the
# engine Datafaker uses). Use it for structured IDs/references. Invalid patterns fail fast at load;
# generation is deterministic under the seed.
# Quirks: `.` matches any printable ASCII (incl. punctuation) — prefer explicit classes like
# [A-Za-z0-9]; unbounded quantifiers (+ * {n,}) are capped at 100 reps. See config/README.md.
iso_msg_id: "regex:[A-Z0-9]{10,35}" # e.g. R7ZK9444J9
order_ref: "regex:ORD-\\d{8}" # e.g. ORD-40021785
aliases:
beerstyle: beer_style