Skip to content

Commit

Permalink
Update SwifQLVaporTests.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Anisimov committed Aug 24, 2020
1 parent a6aba29 commit a876221
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Tests/SwifQLVaporTests/SwifQLVaporTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,39 @@ final class SwifQLVaporTests: XCTestCase {
}

func testSelectCarBrands() {
checkAllDialects(SwifQL.select(\CarBrands.id, \CarBrands.$name), pg: """
checkAllDialects(SwifQL.select(\CarBrands.$id, \CarBrands.$name), pg: """
SELECT "Car_brands"."id", "Car_brands"."name"
""", mySQL: """
SELECT Car_brands.id, Car_brands.name
""")
}

func testSelectCarBrandsSeveralFields() {
checkAllDialects(SwifQL.select(\CarBrands.id, \CarBrands.name, \CarBrands.$createdAt), pg: """
checkAllDialects(SwifQL.select(\CarBrands.$id, \CarBrands.$name, \CarBrands.$createdAt), pg: """
SELECT "Car_brands"."id", "Car_brands"."name", "Car_brands"."createdAt"
""", mySQL: """
SELECT Car_brands.id, Car_brands.name, Car_brands.createdAt
""")
}

func testSelectCarBrandsWithAlias() {
checkAllDialects(SwifQL.select(cb~\.id), pg: """
checkAllDialects(SwifQL.select(cb~\.$id), pg: """
SELECT "cb"."id"
""", mySQL: """
SELECT cb.id
""")
}

func testSelectCarBrandsWithAliasSeveralFields() {
checkAllDialects(SwifQL.select(cb~\.id, cb~\.name), pg: """
checkAllDialects(SwifQL.select(cb~\.$id, cb~\.$name), pg: """
SELECT "cb"."id", "cb"."name"
""", mySQL: """
SELECT cb.id, cb.name
""")
}

func testSelectCarBrandsSeveralFieldsMixed() {
checkAllDialects(SwifQL.select(\CarBrands.$id, cb~\.name, \CarBrands.createdAt), pg: """
checkAllDialects(SwifQL.select(\CarBrands.$id, cb~\.$name, \CarBrands.$createdAt), pg: """
SELECT "Car_brands"."id", "cb"."name", "Car_brands"."createdAt"
""", mySQL: """
SELECT Car_brands.id, cb.name, Car_brands.createdAt
Expand Down

0 comments on commit a876221

Please sign in to comment.