Skip to content
faker.tools
All 79

Plate IV · Developer, API & Database Seeding Utilities

SQL INSERT Statement Generator

Seed scripts for PostgreSQL, MySQL, SQLite and SQL Server.

sql
CREATE TABLE "users" (
  "id" INTEGER PRIMARY KEY,
  "fullName" VARCHAR(128),
  "email" VARCHAR(255),
  "city" VARCHAR(96),
  "isActive" BOOLEAN,
  "createdAt" TIMESTAMPTZ
);

INSERT INTO "users" ("id", "fullName", "email", "city", "isActive", "createdAt") VALUES
  (1, 'Alice Young', 'alice.young@example.com', 'Boise', TRUE, '2025-11-01T21:05:30Z'),
  (2, 'Ryan Lopez', 'ryan.lopez@example.com', 'Brooklyn', TRUE, '2026-01-09T21:05:30Z'),
  (3, 'Linda Anderson', 'linda.anderson@example.com', 'Savannah', FALSE, '2026-01-21T21:05:30Z'),
  (4, 'Iris Martin', 'iris.martin@example.com', 'Portland', TRUE, '2024-02-09T21:05:30Z'),
  (5, 'Thomas Moore', 'thomas.moore@example.com', 'Boise', TRUE, '2025-05-06T21:05:30Z'),
  (6, 'Patricia Smith', 'patricia.smith@example.com', 'Portland', TRUE, '2025-12-12T21:05:30Z'),
  (7, 'Margaret Garcia', 'margaret.garcia@example.com', 'Boise', FALSE, '2026-03-20T21:05:30Z'),
  (8, 'Elijah Williams', 'elijah.williams@example.com', 'Austin', FALSE, '2026-04-14T21:05:30Z'),
  (9, 'Jason Hill', 'jason.hill@example.com', 'Savannah', TRUE, '2026-05-27T21:05:30Z'),
  (10, 'Jason Davis', 'jason.davis@example.com', 'Savannah', TRUE, '2025-10-10T21:05:30Z');
20 lines · 1.2 KBGenerated in your browser · SQL INSERT Statement Generator

Column types and identifier quoting differ enough between dialects that a script written for Postgres will not run on MySQL. Pick a dialect here and both the types and the quoting come out right, so the script runs as pasted.

What you can control

  • Four dialects with correct type mapping — TIMESTAMPTZ in Postgres becomes DATETIME in MySQL and TEXT in SQLite.
  • Identifier quoting follows each dialect: double quotes, backticks or square brackets.
  • One multi-row INSERT for speed, or one statement per row when you need them individually.
  • Optional transaction wrapping and a truncate statement for repeatable re-seeding.

What this is not

The generated CREATE TABLE has no indexes, foreign keys or constraints beyond a primary key. It is a seed script, not a schema migration.

Questions

Does the CREATE TABLE include indexes?

No, just columns and a primary key on id when that field is present. Add indexes and constraints in your own migration.

Are string values escaped safely?

Single quotes are doubled, which is the standard SQL escape. The values themselves are generated rather than user-supplied, so there is nothing hostile in them.

Why is one multi-row INSERT faster?

Because it is one statement and one round trip instead of hundreds. For thousands of rows the difference is substantial.

Next in Developer

All 11