{% extends "master.html" %} {% block main %}

API Documentation

Using the API for this application is pretty simple. Just send a POST request to

http://sqlformat.appspot.com/format/

Options

The POST request accepts various options to control formatting. Only the data option is required. All others are optional.

data
The SQL statement to format.
remove_comments
Set to 1 to remove comments.
keyword_case
How to convert keywords. Allowed values are 'lower', 'upper', 'capitalize'.
identifier_case
How to convert identifiers. Allowed values are 'lower', 'upper', 'capitalize'.
n_indents
An integer indicating the indendation depth.
right_margin
An integer indicating the maximum line length.
output_format
Transfer the statement into another programming language. Allowed values are 'python', 'php'

Example

Here's a example in Python:

{% include "python-client-example.html" %}

Download sqlformat_example_client.py

{% endblock %}