summaryrefslogtreecommitdiff
path: root/extras/appengine/templates/api.html
blob: b9aaae7c2ea10bf7ce2f1010bbc093fbd3c71ea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{% extends "master.html" %}

{% block main %}
<h1>API Documentation</h1>

<p>
  Using the API for this application is pretty simple. Just send a
  <code>POST</code> request to
</p>
<p>
  <code>http://sqlformat.appspot.com/format/</code>
</p>

<h2>Options</h2>
<p>
  The <code>POST</code> request accepts various options to control
  formatting. Only the <em>data</em> option is required. All others
  are optional.
</p>

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

<h2>Example</h2>
<p>
  Here's a example in Python:
</p>
{% include "python-client-example.html" %}
<p>
  <a href="/static/sqlformat_client_example.py">Download sqlformat_example_client.py</a>
</p>

{% endblock %}