Tools
Support
WORKSPACE

SQL Generator

Build SELECT, INSERT, UPDATE, DELETE, UPSERT and CREATE TABLE for your database from fields, data or a class.

WELL / TOOLS

Free for everyone. Sustained by those who can contribute.

No ads and no limits. A voluntary contribution helps with hosting and new tools. Support is optional and unlocks no perks.

The generator builds the SQL statement in the syntax of the database you choose: quoted names, TOP or LIMIT, dates, booleans and UPSERT with ON DUPLICATE KEY, ON CONFLICT or MERGE. Enter fields in a grid, paste a list of records as JSON or CSV, or paste a class from your project and the tool reads its properties, types and annotations such as [Key], [Table] and @Column.

How to use

  1. Choose the database, the operation and the table.
  2. Fill in fields and values, paste records or import a class.
  3. Check the key field and copy the generated SQL.

Frequently asked questions

Which class languages are supported?

C# (including records and Entity Framework attributes), Java/JPA, Kotlin, TypeScript, Python (dataclass, Pydantic, SQLAlchemy), PHP and Go (with db and gorm tags).

What is UPSERT?

A statement that inserts the row if it does not exist and updates it if it does. Each database has its own syntax and the tool uses the right one.

Why use parameters instead of values?

In application code, parameters (@name, ?, $1) prevent SQL injection. Literal values are for scripts and tests.

Is my data sent to a server?

No. The SQL is generated in your browser.

Related tools