If you only want to extract the values for the 'a'
keys in column
then say exactly that and let the database do the work:
conn.exec(%q{SELECT column -> 'a' FROM database}).each do |_, a|
# The value will be in `a`, `_` will be the made up column name.
end
or, if you want to work with other things:
conn.exec(%q{SELECT other_column, column -> 'a' as col_at_a FROM database}).each do |row|
# Look at `row['other_column']` and `row['col_at_a']` ...
end