Method: WIKK::SQL#query_sym
- Defined in:
-
lib/wikk_mysql2.rb,
lib/wikk_ruby_mysql.rb
@result and @affected_rows are also set via call to query().
Yields query result row by row, as Hash using Symbol keys, so can’t have table names included. This can be used with keyword arguments. eg. each_sym { |key1:, key2:, …, **rest_of_args| do something }
245 246 247 248 249 250 251 252 253 254 |
# File 'lib/wikk_mysql2.rb', line 245 def each_sym(the_query, &block) query(the_query, { symbolize_keys: true, as: :hash, cache_rows: false }) if @result != nil if block_given? @result.each(&block) else return @result.to_a end end end |