'Generate default values for compiled insert/update statements,
and generate inserted_primary_key collection.'

def __process_defaults(self):

    key_getter = self.compiled._key_getters_for_crud_column[2]
    if self.executemany:
        if len(self.compiled.prefetch):
            scalar_defaults = {}
            for c in self.prefetch_cols:
                if (self.isinsert and c.default and c.default.is_scalar):
                    scalar_defaults[c] = c.default.arg
                elif (self.isupdate and c.onupdate and c.onupdate.is_scalar):
                    scalar_defaults[c] = c.onupdate.arg
            for param in self.compiled_parameters:
                self.current_parameters = param
                for c in self.prefetch_cols:
                    if (c in scalar_defaults):
                        val = scalar_defaults[c]
                    elif self.isinsert:
                        val = self.get_insert_default(c)
                    else:
                        val = self.get_update_default(c)
                    if (val is not None):
                        param[key_getter(c)] = val
            del self.current_parameters
    else:
        self.current_parameters = compiled_parameters = self.compiled_parameters[0]
        for c in self.compiled.prefetch:
            if self.isinsert:
                val = self.get_insert_default(c)
            else:
                val = self.get_update_default(c)
            if (val is not None):
                compiled_parameters[key_getter(c)] = val
        del self.current_parameters
        if self.isinsert:
            self.inserted_primary_key = [self.compiled_parameters[0].get(key_getter(c), None) for c in self.compiled.statement.table.primary_key]
