module Sequel::LitRequireFrozen::DatasetMethods

Public Instance Methods

placeholder_literal_string_sql_append(sql, pls) click to toggle source

Check that placeholder string is frozen (or all entries in placeholder array are frozen).

Calls superclass method
   # File lib/sequel/extensions/lit_require_frozen.rb
87 def placeholder_literal_string_sql_append(sql, pls)
88   str = pls.str
89 
90   if str.is_a?(Array)
91     str.each do |s|
92       _check_unfrozen_literal_string(s)
93     end
94   else
95     _check_unfrozen_literal_string(str)
96   end
97 
98   super
99 end
with_sql(sql, *args) click to toggle source

Check given SQL is not an unfrozen string.

Calls superclass method
   # File lib/sequel/extensions/lit_require_frozen.rb
80 def with_sql(sql, *args)
81   _check_unfrozen_literal_string(sql)
82   super
83 end

Private Instance Methods

_check_unfrozen_literal_string(str) click to toggle source

Base method that other methods used to check for whether a string should be allowed as literal SQL. Allows non-strings as well as frozen strings.

    # File lib/sequel/extensions/lit_require_frozen.rb
105 def _check_unfrozen_literal_string(str)
106   return if !str.is_a?(String) || str.frozen?
107 
108   if str.is_a?(LiteralString)
109     _check_unfrozen_literal_string(str.source)
110   else
111     raise Error, "cannot treat unfrozen string as literal SQL: #{str.inspect}"
112   end
113 end
literal_literal_string_append(sql, v) click to toggle source

Check literal strings appended to SQL.

Calls superclass method
    # File lib/sequel/extensions/lit_require_frozen.rb
116 def literal_literal_string_append(sql, v)
117   _check_unfrozen_literal_string(v)
118   super
119 end
static_sql(sql) click to toggle source

Check static SQL is not frozen.

Calls superclass method
    # File lib/sequel/extensions/lit_require_frozen.rb
122 def static_sql(sql)
123   _check_unfrozen_literal_string(sql)
124   super
125 end