Sha256: 3faf8065e9b330f2479bbdea6993e76dd21b18a124bd785190980776e353332a

Contents?: true

Size: 543 Bytes

Versions: 14

Compression:

Stored size: 543 Bytes

Contents

class Kiss
  module SequelMySQLDataset
    # Returns results from dataset query as array of arrays,
    # instead of array of hashes. 
    def all_arrays(opts = nil, &block)
      a = []
      fetch_arrays(select_sql()) {|r| a << r}
      a.each(&block) if block
      a
    end
    
    # Fixes bug in Sequel 1.5; shouldn't be needed for Sequel 2.x
    # (need to double-check, however).
    def fetch_arrays(sql)
      execute(sql) do |r|
        while row = r.fetch_row
          yield row
        end
      end
      self
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kiss-1.8.9 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.8 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.7 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.6 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.5 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.4 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.3 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.2 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8.1 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.8 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.7.4 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.7.2 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.7.1 lib/kiss/ext/sequel_mysql_dataset.rb
kiss-1.7 lib/kiss/ext/sequel_mysql_dataset.rb