private function getPKValue($table, array $row, $quick = false) {
        if ($quick && isset($row[$table.'ID'])) {
            return [$table.'ID' => $row[$table.'ID']];
        }

        $tdef = $this->fetchTableDef($table);
        $cols = [];
        foreach ($tdef['columns'] as $name => $cdef) {
            if (empty($cdef['primary'])) {
                break;
            }
            if (!array_key_exists($name, $row)) {
                return null;
            }

            $cols[$name] = $row[$name];
        }
        return $cols;
    }