The sqlparse module provides the following functions on module-level.
Split sql into single statements.
Parameters: |
|
---|---|
Returns: | A list of strings. |
Format sql according to options.
Available options are documented in Formatting of SQL Statements.
In addition to the formatting options this function accepts the keyword “encoding” which determines the encoding of the statement.
Returns: | The formatted SQL statement as string. |
---|
Parse sql and return a list of statements.
Parameters: |
|
---|---|
Returns: | A tuple of Statement instances. |
In most cases there’s no need to set the encoding parameter. If encoding is not set, sqlparse assumes that the given SQL statement is encoded either in utf-8 or latin-1.
The format() function accepts the following keyword arguments.