Method: Sequel::Dataset#single_value

Defined in:
lib/sequel/dataset/actions.rb

#single_valueObject

Returns the first value of the first record in the dataset. Returns nil if dataset is empty. Users should generally use get instead of this method. Example:

DB[:test].single_value # SELECT * FROM test LIMIT 1
# => 'value'


854
855
856
857
858
859
# File 'lib/sequel/dataset/actions.rb', line 854

def single_value
  single_value_ds.each do |r|
    r.each{|_, v| return v}
  end
  nil
end