Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.14 KB

File metadata and controls

45 lines (29 loc) · 1.14 KB

:mod:`sqlparse` -- Parse SQL statements

.. module:: sqlparse
   :synopsis: Parse SQL statements.

The :mod:`sqlparse` module provides the following functions on module-level.

.. autofunction:: sqlparse.split

.. autofunction:: sqlparse.format

.. autofunction:: sqlparse.parse


Formatting of SQL Statements

The :meth:`~sqlparse.format` function accepts the following keyword arguments.

keyword_case
Changes how keywords are formatted. Allowed values are "upper", "lower" and "capitalize".
identifier_case
Changes how identifiers are formatted. Allowed values are "upper", "lower", and "capitalize".
strip_comments
If True comments are removed from the statements.
reindent
If True the indentations of the statements are changed.
indent_tabs
If True tabs instead of spaces are used for indentation.
indent_width
The width of the indentation, defaults to 2.
output_format
If given the output is additionally formatted to be used as a variable in a programming language. Allowed values are "python" and "php".