SQL Stored Procedure / CRUD Generator

Paste a CREATE TABLE statement and get create, get-by-key, list, update and delete routines as PostgreSQL functions, MySQL procedures or SQL Server T-SQL procedures.

Use the tool

Why this tool exists

Some teams keep all data access in stored routines, and every new table needs the same five of them. The syntax differs a lot between engines: PostgreSQL uses functions with RETURNS, MySQL has CREATE PROCEDURE with IN parameters, and SQL Server uses T-SQL with its own variable style. Writing them by hand for each table is repetitive and mistakes in parameter lists are common.

This generator reads the table definition and writes the routines for the dialect you choose, so you can start from consistent code and then add checks, permissions and business rules. You can leave out any routine you do not need. The statement is parsed in your browser and your schema is not uploaded.

How to use it

  1. Paste a CREATE TABLE statement into the input box.
  2. Choose the dialect: PostgreSQL, MySQL or SQL Server.
  3. Tick the routines you want: create, get, list, update and delete.
  4. Copy the generated SQL and review it before running it on a development database.

Frequently asked questions

Does it need a primary key?

Yes, get, update and delete routines look rows up by key, so the table should define one. Without a key, generated routines may be missing or use the wrong columns, so add one first.

Is the generated code production-ready?

It is a starting point. It does not add error handling, transactions, permission checks or audit columns. Review each routine, test it and add the rules that your application requires.

Which data types are supported?

Common types for each dialect are carried over into parameters. Unusual types such as arrays, custom domains or spatial columns may need hand edits, so check the parameter list against your table.