# SQLite Formatter

Format SQLite statements with SQLite rules for identifiers in double quotes, backticks or [brackets], X'' blob literals and parameters such as ?1, :name and @name. Clauses like ON CONFLICT, DO UPDATE SET and RETURNING get their own lines, and columns, conditions and subqueries are indented. Unclosed strings and parentheses are reported with line and column, for app and mobile developers.

## Frequently asked questions

### Which SQLite syntax is understood?

Single-quoted strings with doubled quotes, identifiers in double quotes, backticks or [square brackets] and X'' blob literals are recognized. The parameter forms ?, ?1, :name, @name and $name are kept as written.

### Which clauses get their own line?

SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT and OFFSET start their own lines. The SQLite upsert clauses ON CONFLICT and DO UPDATE SET and the RETURNING clause do as well.

### Can it format CREATE TABLE statements?

Yes. Column definitions are placed one per line inside the parentheses, and short type arguments such as VARCHAR(20) stay inline.

### Are comments kept?

Yes. Both -- line comments and /* block comments */ stay in place, re-indented to the new layout.

### Does it change the case of keywords?

No. Keywords and identifiers keep the case you wrote. SQLite is case insensitive for keywords, so mixed case still works.

### How are triggers handled?

Trigger bodies between BEGIN and END are indented as a block. Each statement inside starts on its own line.

### What errors are reported?

Unclosed strings, quoted identifiers and block comments, and unbalanced parentheses, each with line and column. The tool does not run the statement or check your schema.

### Can I change the indentation?

Yes. Choose 2 or 4 spaces or tabs. Short lists in parentheses stay on one line and longer ones open an indented block.

### How large can the input be?

Up to 1 MB per request and 128 KB per statement. Several statements are formatted one at a time and separated by blank lines.

### Is my SQL stored?

No. Statements are formatted in memory and returned. They are never saved and only request sizes are logged.

Your ad here?

[Email us](mailto:hi@dennn.is?subject=Advertising%20on%20OneClick%20Pro)

[Ad The agent-ready plugin suite for WordPress.](https://sleekwp.com/?ref=oneclickpro)
