|
1 | 1 | using Query |
2 | | -using Test: @test, @testset |
| 2 | +using Test |
3 | 3 | using QuerySQLite |
4 | 4 | using SQLite: DB |
5 | | -using DataFrames: DataFrame |
| 5 | +using QueryTables |
6 | 6 |
|
7 | 7 | filename = joinpath(@__DIR__, "Chinook_Sqlite.sqlite") |
8 | 8 | database = NamedTuple(OutsideTables(DB(filename))) |
9 | 9 |
|
10 | 10 | @testset "QuerySQLite" begin |
11 | 11 |
|
12 | | -@test names(database.Track |> |
| 12 | +@test database.Track |> |
13 | 13 | @map({_.TrackId, _.Name, _.Composer, _.UnitPrice}) |> |
14 | | - DataFrame) == [:TrackId, :Name, :Composer, :UnitPrice] |
| 14 | + collect |> |
| 15 | + first |> |
| 16 | + propertynames == (:TrackId, :Name, :Composer, :UnitPrice) |
15 | 17 |
|
16 | 18 | @test (database.Customer |> |
17 | 19 | @map({_.City, _.Country}) |> |
18 | 20 | @orderby(_.Country) |> |
19 | | - DataFrame).Country[1] == "Argentina" |
| 21 | + DataTable).Country[1] == "Argentina" |
20 | 22 |
|
21 | | -@test length((database.Customer |> |
| 23 | +@test database.Customer |> |
22 | 24 | @map({_.City}) |> |
23 | 25 | @unique() |> |
24 | | - DataFrame).City) == 53 |
| 26 | + collect |> |
| 27 | + length == 53 |
25 | 28 |
|
26 | | -@test length((database.Track |> |
| 29 | +@test database.Track |> |
27 | 30 | @map({_.TrackId, _.Name}) |> |
28 | 31 | @take(10) |> |
29 | | - DataFrame).Name) == 10 |
| 32 | + collect |> |
| 33 | + length == 10 |
30 | 34 |
|
31 | 35 | @test first((database.Track |> |
32 | 36 | @map({_.TrackId, _.Name}) |> |
33 | 37 | @drop(10) |> |
34 | 38 | @take(10) |> |
35 | | - DataFrame).Name) == "C.O.D." |
| 39 | + DataTable).Name) == "C.O.D." |
36 | 40 |
|
37 | 41 | @test first((database.Track |> |
38 | 42 | @map({_.TrackId, _.Name, _.Bytes}) |> |
39 | 43 | @orderby_descending(_.Bytes) |> |
40 | 44 | @thenby(_.Name) |> |
41 | | - DataFrame).Bytes) == 1059546140 |
| 45 | + DataTable).Bytes) == 1059546140 |
42 | 46 |
|
43 | 47 | end |
0 commit comments