Expand description
How a comment is written into generated SQL.
Every comment Razeri writes is a block comment, /* … */. A line comment
(-- …) ends at the end of its line, so a tool that joins a script’s lines
into one, as a minifier or a copy through a single-line field does, turns
everything after the first -- into comment, and the statements that
followed it are gone without an error. A block comment closes itself, so
the same script still runs with its line endings turned into spaces.
SqlRenderer::render_comment is the
one place a dialect can change that, and its default is block_comment.
No dialect Razeri carries overrides it: every engine it writes SQL for
reads /* … */.
Constants§
- BLOCK_
COMMENT_ HANG - What each line of a block comment after its first is indented by, so it
lines up under the text that follows the opening
/*.
Functions§
- block_
comment - A comment in the block form, ready to stand on its own lines.
- comment_
line_ flags - Whether each line of
textis wholly comment: inside a block comment, opening one, or a line comment. One flag per line, in order. - comment_
lines_ apart - A statement’s comment lines, apart from its other lines: each line that is wholly comment (inside a block comment, or opening one, or a line comment), and the rest, each in its order.
- cron_
in_ comment - A cron expression as a comment can carry it, with the same schedule.