"?string", "table" => "?string", "schema" => "?array", "cols" => "?array", "values" => "?array", "where" => "?array", "suffix" => "?string", ]; static function isa(string $sql): bool { return preg_match("/^update\b/i", $sql); } static function parse(array $query, ?array &$params=null): string { #XXX implémentation minimale $sql = [self::merge_seq($query)]; ## préfixe if (($prefix = $query["prefix"] ?? null) !== null) $sql[] = $prefix; ## table $sql[] = $query["table"]; ## set _query::parse_set_values($query["values"], $setsql, $params); $sql[] = "set"; $sql[] = implode(", ", $setsql); ## where $where = $query["where"] ?? null; if ($where !== null) { _query::parse_conds($where, $wheresql, $params); if ($wheresql) { $sql[] = "where"; $sql[] = implode(" and ", $wheresql); } } ## suffixe if (($suffix = $query["suffix"] ?? null) !== null) $sql[] = $suffix; ## fin de la requête return implode(" ", $sql); } }