Skip to content

Commit 89d1619

Browse files
committed
Merge pull request stephencelis#153 from huynhphan89/master
Add select functions with array param for query builder
2 parents fde8c33 + f791d36 commit 89d1619

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

SQLite/Query.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ public struct Query {
7373
///
7474
/// :returns: A query with the given SELECT clause applied.
7575
public func select(all: Expressible...) -> Query {
76+
return select(all)
77+
}
78+
79+
/// Sets the SELECT clause on the query.
80+
///
81+
/// :param: all A list of expressions to select.
82+
///
83+
/// :returns: A query with the given SELECT clause applied.
84+
public func select(all: [Expressible]) -> Query {
7685
var query = self
7786
(query.distinct, query.columns) = (false, all)
7887
return query
@@ -84,6 +93,15 @@ public struct Query {
8493
///
8594
/// :returns: A query with the given SELECT DISTINCT clause applied.
8695
public func select(distinct columns: Expressible...) -> Query {
96+
return select(distinct: columns)
97+
}
98+
99+
/// Sets the SELECT DISTINCT clause on the query.
100+
///
101+
/// :param: columns A list of expressions to select.
102+
///
103+
/// :returns: A query with the given SELECT DISTINCT clause applied.
104+
public func select(distinct columns: [Expressible]) -> Query {
87105
var query = self
88106
(query.distinct, query.columns) = (true, columns)
89107
return query

0 commit comments

Comments
 (0)