diff --git a/src/model_row.jl b/src/model_row.jl index ca6de9c..ce6fb7b 100644 --- a/src/model_row.jl +++ b/src/model_row.jl @@ -57,6 +57,6 @@ function length(group_of_rows::GroupRow) end function model_row_call(::typeof(QueryOperators.groupby), ungrouped, group_function, group_function_expression, map_selector, map_function_expression) - model = model_row(ungrouped) + model = map_selector(model_row(ungrouped)) GroupRow(group_function(model), model) end diff --git a/src/show.jl b/src/show.jl index f7d2ad1..240ffc8 100644 --- a/src/show.jl +++ b/src/show.jl @@ -175,10 +175,10 @@ julia> using QuerySQLite julia> database = Database(joinpath(pathof(QuerySQLite) |> dirname |> dirname, "test", "Chinook_Sqlite.sqlite")); julia> get_sql(database.Track) -FROM (Track) +SELECT * FROM (Track) ``` """ function get_sql(it) - translate(it.code) + finalize(translate(it.code)) end export get_sql diff --git a/src/translate.jl b/src/translate.jl index ca769e2..f7dd6a5 100644 --- a/src/translate.jl +++ b/src/translate.jl @@ -216,7 +216,7 @@ end @translate_default ::typeof(repr) :QUOTE -function translate_call(::typeof(rand), ::Type{Int}; _primary = true, digits = 0) +function translate_call(::typeof(rand), ::Type{Int}; _primary = true) SQLExpression(:RANDOM) end diff --git a/test/runtests.jl b/test/runtests.jl index 6eb6579..9f9ae43 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -104,7 +104,7 @@ end @testset "Systematic tests" begin filename = joinpath(@__DIR__, "tmp", "test.sqlite") -isfifo(filename) && rm(filename) +isfile(filename) && rm(filename) cp(joinpath(@__DIR__, "test.sqlite"), filename) connection = DB(filename)