module Sequel::SQLComments

def _sql_comment

The comment to include in the SQL query, if any.
def _sql_comment
  @opts[:comment]
end

def comment(comment)

To uncomment a commented dataset, pass nil as the argument.
Return a modified copy of the dataset that will use the given comment.
def comment(comment)
  clone(:comment=>(format_sql_comment(comment) if comment))
end

def format_sql_comment(comment)

in the comment to a single space.
single line SQL comment, and converts all consecutive whitespace
Format the comment. For maximum compatibility, this uses a
def format_sql_comment(comment)
  " -- #{comment.to_s.gsub(/\s+/, ' ')}\n"
end