lib/cequel_cql2/data_set.rb
def generate_upsert_options(options)
      if keyspace.default_consistency
        options[:consistency] ||= keyspace.default_consistency
      end
      if options.empty?
        ''
      else
        ' USING ' <<
          options.map do |key, value|
            serialized_value =
              case key
              when :consistency then value.to_s.upcase
              when :timestamp then value.to_i
              else value
              end
            "#{key.to_s.upcase} #{serialized_value}"
          end.join(' AND ')
      end
    end
#
# Generate CQL option statement for inserts and updates
#
# @param [Hash] options options for insert
# @option options [Symbol,String] :consistency required consistency for the write
# @option options [Integer] :ttl time-to-live in seconds for the written data
# @option options [Time,Integer] :timestamp the timestamp associated with the column values
#
Generate CQL option statement for inserts and updates
Generate CQL option statement for inserts and updates
def generate_upsert_options(options)
      if keyspace.default_consistency
        options[:consistency] ||= keyspace.default_consistency
      end
      if options.empty?
        ''
      else
        ' USING ' <<
          options.map do |key, value|
            serialized_value =
              case key
              when :consistency then value.to_s.upcase
              when :timestamp then value.to_i
              else value
              end
            "#{key.to_s.upcase} #{serialized_value}"
          end.join(' AND ')
      end
    end
def generate_upsert_options ( options ) if keyspace . default_consistency options [ :consistency ] ||= keyspace . default_consistency end if options . empty? '' else ' USING ' << options . map do | key , value | serialized_value = case key when :consistency then value . to_s . upcase when :timestamp then value . to_i else value end "#{key.to_s.upcase} #{serialized_value}" end . join ( ' AND ' ) end end
Generate CQL option statement for inserts and updates
Generate CQL option statement for inserts and updates
options
:timestamp the timestamp associated with the column values
: timestamp the timestamp associated with the column values
options options for insert
options options for insert