Couchbase Lite
Objective-C API for iOS and Mac OS
CBLQuery.h
Go to the documentation of this file.
1 //
2 // CBLQuery.h
3 // Couchbase Lite
4 //
5 // Created by Jens Alfke on 11/30/16.
6 // Copyright © 2016 Couchbase. All rights reserved.
7 //
8 
9 #import <Foundation/Foundation.h>
11 
12 NS_ASSUME_NONNULL_BEGIN
13 
14 
22 @interface CBLQuery : NSObject
23 
25 @property (nonatomic, readonly) CBLDatabase* database;
26 
32 @property (copy, nullable, nonatomic) id where;
33 
40 @property (copy, nullable, nonatomic) NSArray* orderBy;
41 
46 @property (copy, nullable, nonatomic) NSArray* returning;
47 
52 @property (copy, nullable, nonatomic) NSArray* groupBy;
53 
59 @property (copy, nullable, nonatomic) id having;
60 
64 @property (nonatomic) BOOL distinct;
65 
69 @property (nonatomic) NSUInteger offset;
70 
73 @property (nonatomic) NSUInteger limit;
74 
78 @property (copy, nullable, nonatomic) NSDictionary* parameters;
79 
81 - (BOOL) check: (NSError**)error;
82 
93 - (nullable NSString*) explain: (NSError**)outError;
94 
101 - (nullable NSEnumerator<CBLQueryRow*>*) run: (NSError**)error;
102 
105 - (nullable NSEnumerator<CBLDocument*>*) allDocuments: (NSError**)error;
106 
107 - (instancetype) init NS_UNAVAILABLE;
108 
109 @end
110 
111 
112 NS_ASSUME_NONNULL_END
instancetype NS_UNAVAILABLE()
NSArray * returning
An array of NSExpressions (or expression format strings) describing values to include in each result ...
Definition: CBLQuery.h:46
A Couchbase Lite database.
Definition: CBLDatabase.h:77
NSArray * orderBy
An array of NSSortDescriptors or NSStrings, specifying properties or expressions that the result rows...
Definition: CBLQuery.h:40
id having
Specifies a condition (predicate) that grouped rows have to match; corresponds to the HAVING clause o...
Definition: CBLQuery.h:59
A compiled database query.
Definition: CBLQuery.h:22
A Couchbase Lite document.
Definition: CBLDocument.h:36
NSUInteger limit
The maximum number of rows to return; corresponds to the LIMIT property of a SQL or N1QL query...
Definition: CBLQuery.h:73
NSUInteger offset
The number of result rows to skip; corresponds to the OFFSET property of a SQL or N1QL query...
Definition: CBLQuery.h:69
id where
Specifies a condition (predicate) that documents have to match; corresponds to the WHERE clause of a ...
Definition: CBLQuery.h:32
A single result from a CBLQuery.
Definition: CBLQueryRow.h:17
BOOL distinct
If YES, duplicate result rows will be removed so that all rows are unique; corresponds to the DISTINC...
Definition: CBLQuery.h:64
NSArray * groupBy
An array of NSExpressions (or expression format strings) describing how to group rows together: all d...
Definition: CBLQuery.h:52
CBLDatabase * database
The database being queried.
Definition: CBLQuery.h:25
NSDictionary * parameters
Values to substitute for placeholder parameters defined in the query.
Definition: CBLQuery.h:78