module Sequel::Database::SQLComments
def self.extended(db)
def self.extended(db) db.instance_variable_set(:@comment_hashes, {}) db.extend_datasets DatasetSQLComments end
def with_comments(comment_hash)
def with_comments(comment_hash) hashes = @comment_hashes t = Sequel.current new_hash = if hash = Sequel.synchronize{hashes[t]} hash.merge(comment_hash) else comment_hash.dup end yield Sequel.synchronize{hashes[t] = new_hash} ensure if hash Sequel.synchronize{hashes[t] = hash} else t && Sequel.synchronize{hashes.delete(t)} end end