You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECTfoo_bar.value,
substr(
decode(content, encoding),
max(1, foo_bar.start-20),
min(length(decode(content, encoding)) -foo_bar.start, end - start +40)
) AS context
FROM view_response_bodies, foo_bar(decode(content, encoding))
Expected Output
Something like this (I guess that depends on the expression width as well):
SELECTfoo_bar.value,
substr(
decode(content, encoding),
max(1, foo_bar.start-20),
min(
length(decode(content, encoding)) -foo_bar.start,
end - start +40
)
) AS context
FROM view_response_bodies, foo_bar(decode(content, encoding))
Actual Output
The comments point to the most obvious things that are broken
SELECTfoo_bar.value,
SUBSTR(
decode (content, encoding), -- SUBSTR is upper case, but not my user-defined decode() function. To be fair, the docs say " and builtin function names to upper or lowercase."MAX(1, foo_bar.start-20),
MIN(
LENGTH(decode (content, encoding)) -foo_bar.start,
END - start +40-- end/start are columns of the foo_bar virtual table, don't touch them-- Why is this not indented?
)
) AS context -- shouldn't this be indented one more?FROM
view_response_bodies,
foo_bar (decode (content, encoding))
Input data
Couldn't think of a better title, was just going through my saved queries to see how they would be formatted.
https://sql-formatter-org.github.io/sql-formatter/ defaults with
SQLite
+uppercase
optionsExpected Output
Something like this (I guess that depends on the expression width as well):
Actual Output
The comments point to the most obvious things that are broken
Usage
https://sql-formatter-org.github.io/sql-formatter/ defaults with
SQLite
+uppercase
optionsThe text was updated successfully, but these errors were encountered: