SQLFormatter (sql_formatter v1.0.0)
View SourceSummary
Functions
Formats a SQL string.
Types
@type opts() :: [ indent: non_neg_integer(), uppercase: boolean(), lines_between_queries: non_neg_integer() ]
Functions
Formats a SQL string.
Options
:indent
: The number of spaces to indent the formatted SQL. Defaults to 2.:uppercase
: Whether to use uppercase for keywords. Defaults tofalse
.:lines_between_queries
: The number of lines to insert between queries. Defaults to 1.
Examples
SQLFormatter.format("SELECT * FROM users")
#=>
"""
SELECT
*
FROM
users
"""
SQLFormatter.format("SELECT * FROM users", indent: 4)
#=>
"""
SELECT
*
FROM
users
"""