Format *sql* according to *options*. Available options are documented in :ref:`formatting`. 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.
(sql: str, encoding: Optional[str] = None, **options: Any)
| 49 | |
| 50 | |
| 51 | def format(sql: str, encoding: Optional[str] = None, **options: Any) -> str: |
| 52 | """Format *sql* according to *options*. |
| 53 | |
| 54 | Available options are documented in :ref:`formatting`. |
| 55 | |
| 56 | In addition to the formatting options this function accepts the |
| 57 | keyword "encoding" which determines the encoding of the statement. |
| 58 | |
| 59 | :returns: The formatted SQL statement as string. |
| 60 | """ |
| 61 | stack = engine.FilterStack() |
| 62 | options = formatter.validate_options(options) |
| 63 | stack = formatter.build_filter_stack(stack, options) |
| 64 | stack.postprocess.append(filters.SerializerUnicode()) |
| 65 | return "".join(stack.run(sql, encoding)) |
| 66 | |
| 67 | |
| 68 | def split( |
nothing calls this directly
no test coverage detected
searching dependent graphs…