public function insertOrUpdate(
        string $table,
        array $values,
        int $updateIgnoreCount = 1,
        ?array $excludeEmptyColumns = null
    ) {
        if (null !== $excludeEmptyColumns) {
            $values = SqlPreparator::setNullValues($values, $excludeEmptyColumns);
        }

        if ($updateIgnoreCount) {
            $ignoreForUpdate = array_slice(array_keys($values), 0, $updateIgnoreCount);
        } else {
            $ignoreForUpdate = [];
        }

        [$sql, $params] = array_values(SqlPreparator::prepareInsertOrUpdate($table, $values, $ignoreForUpdate));

        $this->lastStatement = $this->conn->executeUpdate($sql, $params);

        return $this->getLastInsertId();
    }