Skip to content

Commit

Permalink
GOCBC-732: Fixed various query option names.
Browse files Browse the repository at this point in the history
Change-Id: I839c8645e104aaa7330433bc21202c276a68a3d9
Reviewed-on: http://review.couchbase.org/120384
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Brett Lawson <brett19@gmail.com>
  • Loading branch information
brett19 committed Jan 19, 2020
1 parent d9cb47c commit 717122b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cluster_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (c *Cluster) Query(statement string, opts *QueryOptions) (*QueryResult, err

queryOpts["statement"] = statement

if !opts.AdHoc {
if !opts.Adhoc {
return c.execPreparedN1qlQuery(span, queryOpts, deadline, retryStrategy)
}

Expand Down
2 changes: 1 addition & 1 deletion cluster_queryindexes.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func (qm *QueryIndexManager) getAllIndexes(
q := "SELECT `indexes`.* FROM system:indexes WHERE keyspace_id=?"
rows, err := qm.doQuery(q, &QueryOptions{
PositionalParameters: []interface{}{bucketName},
ReadOnly: true,
Readonly: true,
Timeout: opts.Timeout,
RetryStrategy: opts.RetryStrategy,
parentSpan: tracectx,
Expand Down
16 changes: 8 additions & 8 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ const (
AnalyticsService = ServiceType(gocbcore.CbasService)
)

// QueryProfileType specifies the profiling mode to use during a query.
type QueryProfileType string
// QueryProfileMode specifies the profiling mode to use during a query.
type QueryProfileMode string

const (
// QueryProfileNone disables query profiling
QueryProfileNone = QueryProfileType("off")
// QueryProfileModeNone disables query profiling
QueryProfileModeNone = QueryProfileMode("off")

// QueryProfilePhases includes phase profiling information in the query response
QueryProfilePhases = QueryProfileType("phases")
// QueryProfileModePhases includes phase profiling information in the query response
QueryProfileModePhases = QueryProfileMode("phases")

// QueryProfileTimings includes timing profiling information in the query response
QueryProfileTimings = QueryProfileType("timings")
// QueryProfileModeTimings includes timing profiling information in the query response
QueryProfileModeTimings = QueryProfileMode("timings")
)

// SubdocFlag provides special handling flags for sub-document operations
Expand Down
10 changes: 5 additions & 5 deletions query_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ const (
type QueryOptions struct {
ScanConsistency QueryScanConsistency
ConsistentWith *MutationState
Profile QueryProfileType
Profile QueryProfileMode
ScanCap int
PipelineBatch int
PipelineCap int
ScanWait time.Duration
ReadOnly bool
Readonly bool
MaxParallelism int
ClientContextID string
PositionalParameters []interface{}
NamedParameters map[string]interface{}
Metrics bool
Raw map[string]interface{}

AdHoc bool
Adhoc bool
Timeout time.Duration
RetryStrategy RetryStrategy

Expand Down Expand Up @@ -68,8 +68,8 @@ func (opts *QueryOptions) toMap() (map[string]interface{}, error) {
execOpts["profile"] = opts.Profile
}

if opts.ReadOnly {
execOpts["readonly"] = opts.ReadOnly
if opts.Readonly {
execOpts["readonly"] = opts.Readonly
}

if opts.PositionalParameters != nil && opts.NamedParameters != nil {
Expand Down

0 comments on commit 717122b

Please sign in to comment.