Couchbase Lite
Objective-C API for iOS and Mac OS
CBLQueryBuilder.h
Go to the documentation of this file.
1 //
2 // CBLQueryBuilder.h
3 // CouchbaseLite
4 //
5 // Created by Jens Alfke on 8/4/14.
6 // Copyright (c) 2014-2015 Couchbase, Inc. All rights reserved.
7 //
8 
9 #import "CBLBase.h"
11 
13 
26 @interface CBLQueryBuilder : NSObject
27 
44 - (nullable instancetype) initWithDatabase: (nullable CBLDatabase*)database
45  select: (nullable NSArray*)valueTemplate
46  where: (NSString*)predicateStr
47  orderBy: (nullable NSArray*)sortDescriptors
48  error: (NSError**)outError;
49 
53 - (nullable instancetype) initWithDatabase: (nullable CBLDatabase*)database
54  select: (nullable NSArray*)valueTemplate
55  wherePredicate: (NSPredicate*)predicate
56  orderBy: (nullable NSArray*)sortDescriptors
57  error: (NSError**)outError;
58 
61 - (nullable instancetype) initWithView: (CBLView*)view
62  select: (NSArray*)valueTemplate
63  wherePredicate: (NSPredicate*)predicate
64  orderBy: (nullable NSArray*)sortDescriptors
65  error: (NSError**)outError;
66 
67 - (instancetype) init NS_UNAVAILABLE;
68 
70 @property (readonly, nonatomic) CBLView* view;
71 
75 @property (readonly, nonatomic) NSString* explanation;
76 
82 - (CBLQuery*) createQueryWithContext: (nullable CBLJSONDict*)context;
83 
85 - (nullable CBLQueryEnumerator*) runQueryWithContext: (nullable CBLJSONDict*)context
86  error: (NSError**)outError;
87 
88 @end
89 
90 
#define NS_ASSUME_NONNULL_BEGIN
Definition: CBLBase.h:20
A "view" in a CouchbaseLite database – essentially a persistent index managed by map/reduce...
Definition: CBLView.h:58
A CouchbaseLite database.
Definition: CBLDatabase.h:38
instancetype NS_UNAVAILABLE()
#define nullable
Definition: CBLBase.h:22
Represents a query of a CouchbaseLite 'view', or of a view-like resource like _all_documents.
Definition: CBLQuery.h:34
CBLView * view
The view the query builder is using.
Definition: CBLQueryBuilder.h:70
#define NS_ASSUME_NONNULL_END
Definition: CBLBase.h:21
Enumerator on a CBLQuery's result rows.
Definition: CBLQuery.h:187
NSString * explanation
A human-readable string that explains in pseudocode what the query builder is doing.
Definition: CBLQueryBuilder.h:75
A higher-level interface to views and queries that feels more like a traditional query language or li...
Definition: CBLQueryBuilder.h:26