Method: WIKK::SQL.each_sym
- Defined in:
-
lib/wikk_mysql2.rb,
lib/wikk_ruby_mysql.rb
@result and @affected_rows are also set via call to query().
Create WIKK::SQL instance and set up the mySQL connection, and Run a query on the DB server. 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 }
353 354 355 356 357 358 359 360 361 362 |
# File 'lib/wikk_mysql2.rb', line 353 def self.each_sym(db_config, query, &block) self.connect( db_config ) do |sql| if block_given? sql.each_sym(query, &block) return sql # May be useful to access the affected rows else return sql.each_sym(query) end end end |