public function multiInsertOrUpdate(
        string $table,
        array $rows,
        int $updateIgnoreCount = 1,
        ?array $excludeEmptyColumns = null
    ) {
        if (empty($rows)) {
            return 0;
        }

        if (null !== $excludeEmptyColumns) {
            $rows = SqlPreparator::setNullValues($rows, $excludeEmptyColumns);
        }

        if ($updateIgnoreCount) {
            $ignoreForUpdate = array_slice(SqlPreparator::extractColumnsFromRows($rows), 0, $updateIgnoreCount);
        } else {
            $ignoreForUpdate = [];
        }

        [$sql, $params] = array_values(SqlPreparator::prepareMultiInsertOrUpdate($table, $rows, $ignoreForUpdate));

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

        return $affected;
    }