Skip to main content

Module comment

Module comment 

Source
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 text is 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.