Method: Sequel::Dataset::PreparedStatementMethods#prepared_sql
- Defined in:
- lib/sequel/dataset/prepared_statements.rb
permalink #prepared_sql ⇒ Object
Returns the SQL for the prepared statement, depending on the type of the statement and the prepared_modify_values.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/sequel/dataset/prepared_statements.rb', line 143 def prepared_sql case prepared_type when :select, :all, :each # Most common scenario, so listed first. select_sql when :first, :single_value clone(:limit=>1).select_sql when :insert_select insert_select_sql(*prepared_modify_values) when :insert, :insert_pk insert_sql(*prepared_modify_values) when :update update_sql(*prepared_modify_values) when :delete delete_sql else select_sql end end |