             where     : undefined    # Used for SELECT: If given, must be a map with keys clauses with $::TYPE  (not $1::TYPE!)
                                      # and values the corresponding params.  Also, WHERE must not be in the query already.
                                      # If where[cond] is undefined, then cond is completely **ignored**.
+            set       : undefined    # Appends a SET clause to the query; same format as values.
             values    : undefined    # Used for INSERT: If given, then params and where must not be given.   Values is a map
                                      # {'field1::type1':value, , 'field2::type2':value2, ...} which gets converted to
                                      # ' (field1, field2, ...) VALUES ($1::type1, $2::type2, ...) '

            opts.query += " (#{fields.join(', ')}) VALUES (#{values.join(', ')}) "

        if opts.set?
            fields = []
            values = []
            for field, param of opts.values
                if field.indexOf('::') != -1
                    [field, type] = field.split('::')
                    type = type.trim()
                    v.push("#{field.trim()}=$#{push_param(param, type)}::#{type}")
                    continue
                else
                    fields.push(field)
                    values.push("$#{push_param(param)}")

            opts.query += " SET  (#{fields.join(', ')}) VALUES (#{values.join(', ')}) "

        if opts.conflict?
            if not opts.values?

                    return
                if not param?
                    continue
                z.push(cond.replace('$', "$#{push_param(param)}"))
            if z.length > 0
                opts.query += " WHERE #{z.join(' AND ')}"

