aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/QueryKit/Source/QKQuery.m
diff options
context:
space:
mode:
Diffstat (limited to 'Frameworks/QueryKit/Source/QKQuery.m')
-rw-r--r--Frameworks/QueryKit/Source/QKQuery.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/Frameworks/QueryKit/Source/QKQuery.m b/Frameworks/QueryKit/Source/QKQuery.m
index d26b9f72..4be29ae2 100644
--- a/Frameworks/QueryKit/Source/QKQuery.m
+++ b/Frameworks/QueryKit/Source/QKQuery.m
@@ -100,11 +100,32 @@ static NSString *QKNoQueryTableException = @"QKNoQueryTable";
#pragma mark -
#pragma mark Public API
+/**
+ * Requests that the query be built.
+ *
+ * @return The generated query.
+ */
- (NSString *)query
{
return _query ? [self _buildQuery] : @"";
}
+/**
+ * Clears anything this instance should know about the query it's building.
+ */
+- (void)clear
+{
+ [self setTable:nil];
+ [self setDatabase:nil];
+ [self setQueryType:(QKQueryType)-1];
+
+ [_fields removeAllObjects];
+ [_parameters removeAllObjects];
+ [_updateParameters removeAllObjects];
+ [_groupByFields removeAllObjects];
+ [_orderByFields removeAllObjects];
+}
+
#pragma mark -
#pragma mark Fields