public void AppendFormatted(ReadOnlySpan <char> value)
        {
            AppendParameterReference();

            _queryOptions.Parameter(value.ToString());
        }
        internal QueryOptions CloneIfUsedAlready()
        {
            var cloneNow = _isUsed;

            _isUsed = true;

            if (cloneNow)
            {
                var queryOptions = new QueryOptions()
                                   .Statement(_statement !)
                                   .AdHoc(IsAdHoc)
                                   .AutoExecute(_autoExecute)
                                   .CancellationToken(Token)
                                   .ClientContextId(Guid.NewGuid().ToString())
                                   .FlexIndex(_flexIndex)
                                   .PreserveExpiry(_preserveExpiry)
                                   .Profile(_profile);

                queryOptions._scanVectors = _scanVectors;

                if (_arguments is not null)
                {
                    foreach (var arg in _arguments)
                    {
                        queryOptions.Parameter(arg);
                    }
                }

                if (_rawParameters is not null)
                {
                    foreach (var arg in _rawParameters)
                    {
                        queryOptions.Raw(arg.Key, arg.Value);
                    }
                }

                if (_parameters is not null)
                {
                    foreach (var arg in _parameters)
                    {
                        queryOptions.Parameter(arg.Key, arg.Value);
                    }
                }

                if (_maxServerParallelism.HasValue)
                {
                    queryOptions.MaxServerParallelism(_maxServerParallelism.Value);
                }
                if (_includeMetrics.HasValue)
                {
                    queryOptions.Metrics(_includeMetrics.Value);
                }
                if (_pipelineCapacity.HasValue)
                {
                    queryOptions.PipelineCap(_pipelineCapacity.Value);
                }
                if (_pipelineBatch.HasValue)
                {
                    queryOptions.PipelineBatch(_pipelineBatch.Value);
                }
                if (_readOnly.HasValue)
                {
                    queryOptions.Readonly(_readOnly.Value);
                }
                if (_scanCapacity.HasValue)
                {
                    queryOptions.ScanCap(_scanCapacity.Value);
                }
                if (_timeOut.HasValue)
                {
                    queryOptions.Timeout(_timeOut.Value);
                }
                if (_scanWait.HasValue)
                {
                    queryOptions.ScanWait(_scanWait.Value);
                }

                queryOptions._scanConsistency = _scanConsistency;
                queryOptions.Serializer       = Serializer;
                queryOptions.RequestSpanValue = RequestSpanValue;
                queryOptions.BucketName       = BucketName;
                queryOptions.ScopeName        = ScopeName;
                return(queryOptions);
            }

            return(this);
        }