Fake tables
Make a whole table of test data from a schema with
fake rows, as JSON rows ready for sql bulk_insert, csv write or excelx write. Typical uses: a demo database, data for a SCRUD screen or a load test.fake rows <count> <schema>
Description
Make count rows (0 to 100000) from a schema. Each call gives other values. Returns the JSON rows
Make count rows (0 to 100000) from a schema. Each call gives other values. Returns the JSON rows
Parameters
count: The number of rows - Integer - required
schema: The columns as a JSON object - String - required
count: The number of rows - Integer - required
schema: The columns as a JSON object - String - required
admin
fake rows 3 "{\"id\": {\"type\": \"sequence\"}, \"name\": \"name\", \"city\": \"city\"}"
mentdb
[{"id": 1, "name": "Didier Girard", "city": "La Rochelle"}, {"id": 2, "name": "Bruno Bonnet", "city": "Toulon"}, {"id": 3, "name": "Michel Moreau", "city": "Paris"}]
fake rows <count> <schema> <params>
Description
Make rows with the parameters: seed (the same table on every run), locale (fr, en or en_gb), max_size (in characters, 16 MB by default, 64 MB at most)
Make rows with the parameters: seed (the same table on every run), locale (fr, en or en_gb), max_size (in characters, 16 MB by default, 64 MB at most)
Parameters
count: The number of rows - Integer - required
schema: The columns as a JSON object - String - required
params: The parameters as JSON - String - required
count: The number of rows - Integer - required
schema: The columns as a JSON object - String - required
params: The parameters as JSON - String - required
admin
fake rows 4 "{\"id\": {\"type\": \"sequence\", \"start\": 1001}, \"first_name\": \"first_name\", \"last_name\": \"last_name\", \"email\": {\"type\": \"email\", \"unique\": true}, \"postcode\": \"postcode\", \"city\": \"city\", \"segment\": {\"type\": \"pick\", \"values\": [\"A\", \"B\", \"C\"], \"weights\": [6, 3, 1]}, \"since\": {\"type\": \"date\", \"from\": \"2020-01-01\", \"to\": \"2026-10-31\"}, \"note\": {\"type\": \"text\", \"null_ratio\": 0.5}}" "{\"seed\": 42}"
mentdb
[{"id": 1001, "first_name": "Pauline", "last_name": "Meyer", "email": "pauline.meyer@example.com", "postcode": "74000", "city": "Annecy", "segment": "A", "since": "2022-02-27", "note": "Quis commodo vel pellentesque ullamco laboris non reprehenderit do."}, {"id": 1002, "first_name": "Patrick", "last_name": "Noël", "email": "patrick.noel@example.com", "postcode": "42100", "city": "Saint-Étienne", "segment": "A", "since": "2026-09-21", "note": null}, {"id": 1003, "first_name": "Stéphanie", "last_name": "Faure", "email": "stephanie.faure92@example.com", "postcode": "34000", "city": "Montpellier", "segment": "A", "since": "2023-09-05", "note": null}, {"id": 1004, "first_name": "Émilie", "last_name": "Michel", "email": "emilie_michel@example.org", "postcode": "20090", "city": "Ajaccio", "segment": "B", "since": "2020-04-29", "note": null}]
orders with a foreign key picked from the rows of the customers
admin
fake rows 3 "{\"order_id\": {\"type\": \"pattern\", \"pattern\": \"CMD-#####\", \"unique\": true}, \"customer_id\": {\"type\": \"pick\", \"values\": [{\"id\": 1001, \"name\": \"A\"}, {\"id\": 1002, \"name\": \"B\"}, {\"id\": 1003, \"name\": \"C\"}], \"field\": \"id\"}, \"amount\": {\"type\": \"decimal\", \"min\": 5, \"max\": 500}, \"paid\": {\"type\": \"boolean\", \"probability\": 0.8}}" "{\"seed\": 42}"
mentdb
[{"order_id": "CMD-95988", "customer_id": 1002, "amount": 460.64, "paid": true}, {"order_id": "CMD-23441", "customer_id": 1002, "amount": 272.52, "paid": true}, {"order_id": "CMD-74526", "customer_id": 1003, "amount": 123.15, "paid": false}]
companies whose SIRET and VAT number come from their SIREN
admin
fake rows 2 "{\"company\": \"company\", \"siren\": {\"type\": \"siren\", \"unique\": true}, \"siret\": \"siret\", \"vat\": \"vat_eu\", \"iban\": \"iban\", \"phone\": {\"type\": \"phone\", \"format\": \"international\"}}" "{\"seed\": 1}"
mentdb
[{"company": "Rivière Industrie SAS", "siren": "381053909", "siret": "38105390915752", "vat": "FR55381053909", "iban": "FR7634326277692191505782236", "phone": "+33 6 39 98 62 04"}, {"company": "Conseil Blanchard SAS", "siren": "802845164", "siret": "80284516430546", "vat": "FR90802845164", "iban": "FR7635903399210047993569860", "phone": "+33 1 99 00 03 69"}]
in British English
admin
fake rows 2 "{\"name\": \"name\", \"email\": \"email\", \"phone\": \"phone\", \"address\": \"address\"}" "{\"seed\": 1, \"locale\": \"en_gb\"}"
mentdb
[{"name": "Mia Miller", "email": "mia.miller@example.net", "phone": "07700 900620", "address": "65 Highfield Gardens, Leicester LE3 0HD"}, {"name": "William Cooper", "email": "wcooper@example.org", "phone": "07700 900503", "address": "103 London Close, Birmingham B29 8RW"}]
a unique column with too few values
admin
fake rows 10 "{\"die\": {\"type\": \"number\", \"min\": 1, \"max\": 6, \"unique\": true}}" "{\"seed\": 1}"
mentdb
ERROR: Sorry, an error appears (column 'die': unique asks for 10 different values, but the column has only 6 possible values with these options).
Used in use cases (3 recipes)
Data validation developer › Test the checks of a form with generated SIRET, VAT numbers, IBAN, emails and phones
CRUD & data API developer › Fill a demo database for the screens of an application: customers and their orders
Excel reporting analyst › Prepare a demo sales report that gives the same figures on every server
Data validation developer › Test the checks of a form with generated SIRET, VAT numbers, IBAN, emails and phones
CRUD & data API developer › Fill a demo database for the screens of an application: customers and their orders
Excel reporting analyst › Prepare a demo sales report that gives the same figures on every server
Often used with
sql bulk_insert · sql connect · sql create_table · sql disconnect · sql value · string substr · table group_by · table top
sql bulk_insert · sql connect · sql create_table · sql disconnect · sql value · string substr · table group_by · table top
