Documentation
¶
Overview ¶
Package format lays out schema SQL without changing the statements it reads. It works on the token stream, so the identifiers, the keywords and the expressions come out exactly as they were written; only the whitespace between the tokens moves. The one exception is a quoted identifier that does not need its quotes, which is unquoted after the change is proved to leave the statement's meaning alone.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format returns sql laid out. It fails when sql does not parse, and when the result would not carry the same tokens as the input.
func StripRenamedFrom ¶ added in v1.76.0
StripRenamedFrom removes every "-- pista:renamed-from" line from sql. Only a comment on a line of its own is a directive, so a comment after code stays, and so does text inside a string or a routine body, which the scanner reads as part of that token.
Types ¶
This section is empty.