C# Class Couchbase.N1QL.QueryRequest

Builds a N1QL query request.
Inheritance: IQueryRequest
Afficher le fichier Open project: couchbase/couchbase-net-client Class Usage Examples

Méthodes publiques

Свойство Type Description
ScanConsistencyResolver string>.Dictionary

Private Properties

Свойство Type Description
GetQueryParametersAsFormUrlencoded string
IQueryRequest bool

Méthodes publiques

Méthode Description
AdHoc ( bool adHoc ) : IQueryRequest

If set to false, the client will try to perform optimizations transparently based on the server capabilities, like preparing the statement and then executing a query plan instead of the raw query.

The default is true; the query will executed in an ad-hoc manner, without special optomizations.

AddCredentials ( string username, string password, bool isAdmin ) : IQueryRequest

Adds a set of credentials to the list of credentials, in the form of user/password

Optional.

AddNamedParameter ( ) : IQueryRequest

Adds a collection of named parameters to the parameters to the statement or prepared statement.

Optional.

AddNamedParameter ( string name, object value ) : IQueryRequest

Adds a named parameter to the parameters to the statement or prepared statement.

Optional.

AddPositionalParameter ( ) : IQueryRequest

Adds a list of positional parameters to the statement or prepared statement.

AddPositionalParameter ( object value ) : IQueryRequest

Adds a positional parameter to the parameters to the statement or prepared statement.

Optional.

BaseUri ( Uri baseUri ) : IQueryRequest

Bases the URI.

ClientContextId ( string clientContextId ) : IQueryRequest

Clients the context identifier.

Compression ( Compression compression ) : IQueryRequest

Compression format to use for response data on the wire. Possible values are ZIP, RLE, LZMA, LZO, NONE.

Optional. The default is NONE.

ConsistentWith ( MutationState mutationState ) : IQueryRequest

Provides a means of ensuring "read your own writes" or RYOW consistency on the current query.

Note: ScanConsistency will be overwritten to N1QL.ScanConsistency.AtPlus.

Create ( ) : IQueryRequest

Creates a new QueryRequest object.

Create ( Couchbase.N1QL.QueryPlan plan, string originalStatement ) : IQueryRequest

Creates a query using the given plan as an optimization for the originalStatement.

Create ( string statement ) : IQueryRequest

Creates a new QueryRequest object with the specified statement.

Encoding ( Encoding encoding ) : IQueryRequest

Specifies the desired character encoding for the query results.

Optional.

Format ( System.Text.Format format ) : IQueryRequest

Desired format for the query results.

Optional.

GetBaseUri ( ) : Uri
GetFormValues ( ) : object>.IDictionary

Gets a IDictionary{K, V} of the name/value pairs to be POSTed to the service.

Since values will be POSTed as JSON, here we deal with unencoded typed values (like ints, Lists, etc...) rather than only strings.

GetFormValuesAsJson ( ) : string

Gets the JSON representation of this query for execution in a POST.

GetOriginalStatement ( ) : string

Gets the raw, unprepared N1QL statement.

If the statement has been optimized using Prepared, this will still return the original un-optimized statement.

GetPreparedPayload ( ) : Couchbase.N1QL.QueryPlan

Gets the prepared payload for this N1QL statement if IsPrepared() is true, null otherwise.

MaxServerParallelism ( int parallelism ) : IQueryRequest

Specifies the maximum parallelism for the query. A zero or negative value means the number of logical cpus will be used as the parallelism for the query. There is also a server wide max_parallelism parameter which defaults to 1. If a request includes max_parallelism, it will be capped by the server max_parallelism. If a request does not include max_parallelism, the server wide max_parallelism will be used.

Metrics ( bool includeMetrics ) : IQueryRequest

Specifies that metrics should be returned with query results.

Optional.

Prepared ( Couchbase.N1QL.QueryPlan preparedPlan, string originalStatement ) : IQueryRequest

Sets a N1QL statement to be executed in an optimized way using the given queryPlan.

Required if statement not provided, will erase a previously set Statement.

Pretty ( bool pretty ) : IQueryRequest

Pretty print the output.

True by default.

QueryRequest ( ) : System
QueryRequest ( Couchbase.N1QL.QueryPlan plan, string originalStatement ) : System
QueryRequest ( string statement ) : System
ReadOnly ( bool readOnly ) : IQueryRequest

If a GET request, this will always be true otherwise false.

Any value set here will be overridden by the type of request sent.

ScanConsistency ( ScanConsistency scanConsistency ) : IQueryRequest

Specifies the consistency guarantee/constraint for index scanning.

Optional.

ScanWait ( System.TimeSpan scanWait ) : IQueryRequest

Specifies the maximum time the client is willing to wait for an index to catch up to the vector timestamp in the request. If an index has to catch up, and the ScanWait time is exceed doing so, an error is returned.

Optional.

Signature ( bool includeSignature ) : IQueryRequest

Includes a header for the results schema in the response.

The default is true.

Statement ( string statement ) : IQueryRequest

Sets a N1QL statement to be executed.

Will erase a previous optimization of a statement using Prepared.

Timeout ( System.TimeSpan timeOut ) : IQueryRequest

Sets the maximum time to spend on the request.

Optional - the default is 0ms, which means the request runs for as long as it takes.

ToString ( ) : string

Returns a System.String that represents this instance.

UseStreaming ( bool streaming ) : IQueryRequest

Uses the streaming API for the returned results. This is useful for large result sets in that it limits the working size of the query and helps reduce the possibility of a OutOfMemoryException from occurring.

Private Methods

Méthode Description
GetQueryParametersAsFormUrlencoded ( ) : string
IQueryRequest ( ) : bool

#pragma warning disable 1584,1711,1572,1581,1580 True if the request exceeded it's ClientConfiguration.QueryRequestTimeout #pragma warning restore 1584,1711,1572,1581,1580

Method Details

AdHoc() public méthode

If set to false, the client will try to perform optimizations transparently based on the server capabilities, like preparing the statement and then executing a query plan instead of the raw query.
The default is true; the query will executed in an ad-hoc manner, without special optomizations.
public AdHoc ( bool adHoc ) : IQueryRequest
adHoc bool if set to false the query will be optimized if possible.
Résultat IQueryRequest

AddCredentials() public méthode

Adds a set of credentials to the list of credentials, in the form of user/password
Optional.
username;cannot be null, empty or whitespace.
public AddCredentials ( string username, string password, bool isAdmin ) : IQueryRequest
username string The bucket or username.
password string The password of the bucket.
isAdmin bool True if connecting as an admin.
Résultat IQueryRequest

AddNamedParameter() public méthode

Adds a collection of named parameters to the parameters to the statement or prepared statement.
Optional.
public AddNamedParameter ( ) : IQueryRequest
Résultat IQueryRequest

AddNamedParameter() public méthode

Adds a named parameter to the parameters to the statement or prepared statement.
Optional.
public AddNamedParameter ( string name, object value ) : IQueryRequest
name string The name of the parameter.
value object The value of the parameter.
Résultat IQueryRequest

AddPositionalParameter() public méthode

Adds a list of positional parameters to the statement or prepared statement.
public AddPositionalParameter ( ) : IQueryRequest
Résultat IQueryRequest

AddPositionalParameter() public méthode

Adds a positional parameter to the parameters to the statement or prepared statement.
Optional.
public AddPositionalParameter ( object value ) : IQueryRequest
value object The value of the positional parameter.
Résultat IQueryRequest

BaseUri() public méthode

Bases the URI.
public BaseUri ( Uri baseUri ) : IQueryRequest
baseUri System.Uri The base URI.
Résultat IQueryRequest

ClientContextId() public méthode

Clients the context identifier.
public ClientContextId ( string clientContextId ) : IQueryRequest
clientContextId string The client context identifier.
Résultat IQueryRequest

Compression() public méthode

Compression format to use for response data on the wire. Possible values are ZIP, RLE, LZMA, LZO, NONE.
Optional. The default is NONE.
public Compression ( Compression compression ) : IQueryRequest
compression Compression
Résultat IQueryRequest

ConsistentWith() public méthode

Provides a means of ensuring "read your own writes" or RYOW consistency on the current query.
Note: ScanConsistency will be overwritten to N1QL.ScanConsistency.AtPlus.
public ConsistentWith ( MutationState mutationState ) : IQueryRequest
mutationState MutationState State of the mutation.
Résultat IQueryRequest

Create() public static méthode

Creates a new QueryRequest object.
public static Create ( ) : IQueryRequest
Résultat IQueryRequest

Create() public static méthode

Creates a query using the given plan as an optimization for the originalStatement.
public static Create ( Couchbase.N1QL.QueryPlan plan, string originalStatement ) : IQueryRequest
plan Couchbase.N1QL.QueryPlan The plan.
originalStatement string The original statement, unoptimized.
Résultat IQueryRequest

Create() public static méthode

Creates a new QueryRequest object with the specified statement.
public static Create ( string statement ) : IQueryRequest
statement string The statement.
Résultat IQueryRequest

Encoding() public méthode

Specifies the desired character encoding for the query results.
Optional.
public Encoding ( Encoding encoding ) : IQueryRequest
encoding System.Text.Encoding An enum.
Résultat IQueryRequest

Format() public méthode

Desired format for the query results.
Optional.
public Format ( System.Text.Format format ) : IQueryRequest
format System.Text.Format An enum.
Résultat IQueryRequest

GetBaseUri() public méthode

public GetBaseUri ( ) : Uri
Résultat System.Uri

GetFormValues() public méthode

Gets a IDictionary{K, V} of the name/value pairs to be POSTed to the service.
Since values will be POSTed as JSON, here we deal with unencoded typed values (like ints, Lists, etc...) rather than only strings.
A statement or prepared plan must be provided.
public GetFormValues ( ) : object>.IDictionary
Résultat object>.IDictionary

GetFormValuesAsJson() public méthode

Gets the JSON representation of this query for execution in a POST.
public GetFormValuesAsJson ( ) : string
Résultat string

GetOriginalStatement() public méthode

Gets the raw, unprepared N1QL statement.
If the statement has been optimized using Prepared, this will still return the original un-optimized statement.
public GetOriginalStatement ( ) : string
Résultat string

GetPreparedPayload() public méthode

Gets the prepared payload for this N1QL statement if IsPrepared() is true, null otherwise.
public GetPreparedPayload ( ) : Couchbase.N1QL.QueryPlan
Résultat Couchbase.N1QL.QueryPlan

MaxServerParallelism() public méthode

Specifies the maximum parallelism for the query. A zero or negative value means the number of logical cpus will be used as the parallelism for the query. There is also a server wide max_parallelism parameter which defaults to 1. If a request includes max_parallelism, it will be capped by the server max_parallelism. If a request does not include max_parallelism, the server wide max_parallelism will be used.
public MaxServerParallelism ( int parallelism ) : IQueryRequest
parallelism int
Résultat IQueryRequest

Metrics() public méthode

Specifies that metrics should be returned with query results.
Optional.
public Metrics ( bool includeMetrics ) : IQueryRequest
includeMetrics bool True to return query metrics.
Résultat IQueryRequest

Prepared() public méthode

Sets a N1QL statement to be executed in an optimized way using the given queryPlan.
Required if statement not provided, will erase a previously set Statement.
is .
public Prepared ( Couchbase.N1QL.QueryPlan preparedPlan, string originalStatement ) : IQueryRequest
preparedPlan Couchbase.N1QL.QueryPlan The that was prepared beforehand.
originalStatement string The original statement (eg. SELECT * FROM default) that the user attempted to optimize
Résultat IQueryRequest

Pretty() public méthode

Pretty print the output.
True by default.
public Pretty ( bool pretty ) : IQueryRequest
pretty bool True for the pretty.
Résultat IQueryRequest

QueryRequest() public méthode

public QueryRequest ( ) : System
Résultat System

QueryRequest() public méthode

public QueryRequest ( Couchbase.N1QL.QueryPlan plan, string originalStatement ) : System
plan Couchbase.N1QL.QueryPlan
originalStatement string
Résultat System

QueryRequest() public méthode

public QueryRequest ( string statement ) : System
statement string
Résultat System

ReadOnly() public méthode

If a GET request, this will always be true otherwise false.
Any value set here will be overridden by the type of request sent.
public ReadOnly ( bool readOnly ) : IQueryRequest
readOnly bool True for get requests.
Résultat IQueryRequest

ScanConsistency() public méthode

Specifies the consistency guarantee/constraint for index scanning.
Optional.
StatementPlus are not currently supported by CouchbaseServer.
public ScanConsistency ( ScanConsistency scanConsistency ) : IQueryRequest
scanConsistency ScanConsistency Specify the consistency guarantee/constraint for index scanning.
Résultat IQueryRequest

ScanWait() public méthode

Specifies the maximum time the client is willing to wait for an index to catch up to the vector timestamp in the request. If an index has to catch up, and the ScanWait time is exceed doing so, an error is returned.
Optional.
public ScanWait ( System.TimeSpan scanWait ) : IQueryRequest
scanWait System.TimeSpan The maximum time the client is willing to wait for index to catch up to the vector timestamp.
Résultat IQueryRequest

Signature() public méthode

Includes a header for the results schema in the response.
The default is true.
public Signature ( bool includeSignature ) : IQueryRequest
includeSignature bool True to include a header for the results schema in the response.
Résultat IQueryRequest

Statement() public méthode

Sets a N1QL statement to be executed.
Will erase a previous optimization of a statement using Prepared.
statement
public Statement ( string statement ) : IQueryRequest
statement string Any valid N1QL statement for a POST request, or a read-only N1QL statement (SELECT, EXPLAIN) for a GET request.
Résultat IQueryRequest

Timeout() public méthode

Sets the maximum time to spend on the request.
Optional - the default is 0ms, which means the request runs for as long as it takes.
public Timeout ( System.TimeSpan timeOut ) : IQueryRequest
timeOut System.TimeSpan Maximum time to spend on the request
Résultat IQueryRequest

ToString() public méthode

Returns a System.String that represents this instance.
public ToString ( ) : string
Résultat string

UseStreaming() public méthode

Uses the streaming API for the returned results. This is useful for large result sets in that it limits the working size of the query and helps reduce the possibility of a OutOfMemoryException from occurring.
public UseStreaming ( bool streaming ) : IQueryRequest
streaming bool if set to true streams the results as you iterate through the response.
Résultat IQueryRequest

Property Details

ScanConsistencyResolver public_oe static_oe property

public static Dictionary ScanConsistencyResolver
Résultat string>.Dictionary