Configuration Cheatsheet¶
Use this page as a quick lookup when writing faux-db configuration files.
Schema skeleton¶
table_name:
rows: 100
columns:
col_a:
type: faker
method: word
col_b:
type: provider
target: MyProvider
output:
format: csv
filepath: ./outputs/table_name.csv
Column types¶
Faker column¶
Provider column¶
Relationship column¶
Function column¶
Provider types¶
random_choice¶
template_choice¶
WelcomeLineProvider:
type: template_choice
templates:
- '{{ catalog("demo.greetings") | cycle }} {{ catalog("demo.user_suffixes") | random }}'
expression¶
Only random_int(min, max) is supported at the moment.
file_reader¶
CountrySeedProvider:
type: file_reader
filepath: countries.csv
loaded_columns: [country_code, country_name]
Lookup mode¶
country_name:
type: provider
target: CountrySeedProvider
mode: lookup
lookup:
key_columns: [country_code]
key_from: country_code
value_column: country_name
on_missing: null
Catalog expression¶
{{ catalog("demo.greetings") | random }}
{{ catalog("demo.user_suffixes") | first }}
{{ catalog("demo.user_suffixes") | default("friend") | cycle }}