def add_rec params
      grid = ["ver:\"#{@haystack_version}\" commit:\"add\""]
      grid << params.map{|p| p[:name]}.join(',')
      values = params.map do |p|
        p[:value] = "\"#{p[:value]}\"" if p[:type] == 'String'
        p[:value]
      end
      grid << values.join(',')
      res = commit grid 
      # return id of new rec
      res['rows'][0]['id']     
    end
def add_rec params
      grid = ["ver:\"#{@haystack_version}\" commit:\"add\""]
      grid << params.map{|p| p[:name]}.join(',')
      values = params.map do |p|
        p[:value] = "\"#{p[:value]}\"" if p[:type] == 'String'
        p[:value]
      end
      grid << values.join(',')
      res = commit grid 
      # return id of new rec
      res['rows'][0]['id']     
    end
params is array of hashes: {name: xx, type: xx, value: xx}