Skip to content
OddsockLocal
Local
Source text
Dataset (leave input blank for preset)users
Outputjson
Rows10
ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Leave the input blank and pick Dataset, or type a field list.
  2. Choose Output: json, csv, sql or typescript.
  3. Set Rows and Seed.
  4. Copy the result. SQL uses double-quoted identifiers and single-quoted strings.

What is Mock data?

The data generator is the preset datasets with a format switch. Dataset orders, output sql, one row, seed guide writes INSERT INTO "orders" ("id", "customer", "product", "quantity", "total", "status") VALUES (1, 'Eden Taylor', 'Tote bag', 8, 287.14, 'shipped');. The same seed on the user preset is a different shape: id, name, email, address. Output can be json, csv, sql or typescript. JSON is the start on this page.

Read more

Blank input uses the preset. orders is id, a customer name, a product, a quantity, a price and a status. products is id, product, price and stock. users is id, name, email and address. Type your own name:type list when the preset is wrong. Quantity is a small integer, price is a decimal, status is one of pending, paid, shipped, delivered. Emails stay on example.test.

SQL identifiers are double-quoted, matching the other SQL writers. TypeScript output is a const array and a type alias. The CSV and JSON pages are the same generator with the format already chosen. The seed is what makes a row repeatable. One order with seed guide is this tote bag, not a random product on the next visit.

Use cases

  • A database seed should be one INSERT of a shipped tote bag, total 287.14, that you can run twice and recognize.
  • You need the same rows as TypeScript for a test and as SQL for a migration, by changing Output.
  • The orders preset is enough and you do not want to type the column list.
  • A custom field list should fail if the type is not one the generator knows.

One order as SQL, seed guide

Dataset orders, output sql, rows 1, seed guide. Input blank.

INSERT INTO "orders" ("id", "customer", "product", "quantity", "total", "status") VALUES (1, 'Eden Taylor', 'Tote bag', 8, 287.14, 'shipped');

Why use Oddsock

Format is a switch on one generator. You should not have to re-roll the people because you needed SQL instead of JSON.

Related tools

Using this tool

id, customer, product, quantity, total and status. With seed guide and one row, that is Eden Taylor, Tote bag, quantity 8, total 287.14, status shipped.