diff --git a/SQLite/Typed/Query.swift b/SQLite/Typed/Query.swift index 634b1b6a..e5319533 100644 --- a/SQLite/Typed/Query.swift +++ b/SQLite/Typed/Query.swift @@ -50,8 +50,8 @@ extension SchemaType { /// - Parameter all: A list of expressions to select. /// /// - Returns: A query with the given `SELECT` clause applied. - public func select(column1: Expressible, _ column2: Expressible, _ more: Expressible...) -> Self { - return select(false, [column1, column2] + more) + public func select(column1: Expressible, _ more: Expressible...) -> Self { + return select(false, [column1] + more) } /// Builds a copy of the query with the `SELECT DISTINCT` clause applied. @@ -65,8 +65,8 @@ extension SchemaType { /// - Parameter columns: A list of expressions to select. /// /// - Returns: A query with the given `SELECT DISTINCT` clause applied. - public func select(distinct column1: Expressible, _ column2: Expressible, _ more: Expressible...) -> Self { - return select(true, [column1, column2] + more) + public func select(distinct column1: Expressible, _ more: Expressible...) -> Self { + return select(true, [column1] + more) } /// Builds a copy of the query with the `SELECT` clause applied. diff --git a/SQLiteTests/QueryTests.swift b/SQLiteTests/QueryTests.swift index b25f2620..b76da61e 100644 --- a/SQLiteTests/QueryTests.swift +++ b/SQLiteTests/QueryTests.swift @@ -20,6 +20,14 @@ class QueryTests : XCTestCase { func test_select_withExpression_compilesSelectClause() { AssertSQL("SELECT \"email\" FROM \"users\"", users.select(email)) } + + func test_select_withStarExpression_compilesSelectClause() { + AssertSQL("SELECT * FROM \"users\"", users.select(*)) + } + + func test_select_withNamespacedStarExpression_compilesSelectClause() { + AssertSQL("SELECT \"users\".* FROM \"users\"", users.select(users[*])) + } func test_select_withVariadicExpressions_compilesSelectClause() { AssertSQL("SELECT \"email\", count(*) FROM \"users\"", users.select(email, count(*)))