Description Usage Arguments Details Value See Also Examples
View source: R/sqlparse_retic.R
Beautifies SQL statements according to numerous formatting settings.
1 2 3 4 5 6 7 | sql_format(sql, keyword_case = NULL, identifier_case = NULL,
strip_comments = TRUE, reindent = FALSE, indent_width = 2,
indent_tabs = FALSE, indent_after_first = FALSE,
indent_columns = FALSE, reindent_aligned = FALSE,
use_space_around_operators = FALSE, wrap_after = NULL,
comma_first = FALSE, truncate_strings = NULL,
truncate_char = "[...]", encoding = NULL)
|
sql |
Character string containing one or more SQL statements to be formatted. |
keyword_case |
Character string specifying how keywords are formatted. Options: |
identifier_case |
Character string specifying how identifiers are formatted. Options: |
strip_comments |
Boolean; if |
reindent |
Boolean; if |
indent_width |
Positive integer specifying the width of the indentation. Default: |
indent_tabs |
Boolean; if |
indent_after_first |
Boolean; if |
indent_columns |
Boolean; if |
reindent_aligned |
Boolean; if |
use_space_around_operators |
Boolean; if |
wrap_after |
Positive integer specifying the column limit (in characters) for wrapping comma-separated lists. If |
comma_first |
Boolean; if |
truncate_strings |
Positive integer; string literals longer than the given value are truncated. Default: |
truncate_char |
Character string appended if long string literals are truncated. Default: |
encoding |
Character string specifying the input encoding. Default: |
This function is a wrapper to the sqlparse.format() function from the sqlparse Python module, which is a non-validating SQL parser.
Character string containing the formatted SQL statements.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.