module Sequel::Plugins::SqlComments::ClassMethods

Public Instance Methods

sql_comments_class_methods(*meths) click to toggle source

Use automatic SQL comments for the given class methods.

   # File lib/sequel/plugins/sql_comments.rb
81 def sql_comments_class_methods(*meths)
82   _sql_comments_methods(singleton_class, :class, meths)
83 end
sql_comments_dataset_methods(*meths) click to toggle source

Use automatic SQL comments for the given dataset methods.

   # File lib/sequel/plugins/sql_comments.rb
91 def sql_comments_dataset_methods(*meths)
92   unless @_sql_comments_dataset_module
93     dataset_module(@_sql_comments_dataset_module = Sequel.set_temp_name(Module.new){"#{name}::@_sql_comments_dataset_module"})
94   end
95   _sql_comments_methods(@_sql_comments_dataset_module, :dataset, meths)
96 end
sql_comments_instance_methods(*meths) click to toggle source

Use automatic SQL comments for the given instance methods.

   # File lib/sequel/plugins/sql_comments.rb
86 def sql_comments_instance_methods(*meths)
87   _sql_comments_methods(self, :instance, meths)
88 end

Private Instance Methods

_sql_comments_methods(mod, method_type, meths) click to toggle source

Define automatic SQL comment methods in mod for each method in meths, with the given method_type.

    # File lib/sequel/plugins/sql_comments.rb
119 def _sql_comments_methods(mod, method_type, meths)
120   meths.each do |meth|
121     SqlComments.def_sql_commend_method(mod, self, method_type, meth)
122   end
123 end
reset_fast_pk_lookup_sql() click to toggle source

Don’t optimize the fast PK lookups, as it uses static SQL that won’t support the SQL comments.

    # File lib/sequel/plugins/sql_comments.rb
113 def reset_fast_pk_lookup_sql
114   @fast_pk_lookup_sql = @fast_instance_delete_sql = nil
115 end