diff --git a/Project.toml b/Project.toml index 07a4398..9e1c3ac 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SearchLight" uuid = "340e8cb6-72eb-11e8-37ce-c97ebeb32050" authors = ["Adrian Salceanu "] -version = "2.3" +version = "2.3.1" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/src/SearchLight.jl b/src/SearchLight.jl index 4c35622..298a3f6 100644 --- a/src/SearchLight.jl +++ b/src/SearchLight.jl @@ -28,7 +28,7 @@ include("Callbacks.jl") export find, findone export rand, randone -export all, count # min, max, mean, median +export all # min, max, mean, median export findone_or_create, createwith, updateby_or_create, update_or_create export save, save!, save!!, updatewith!, updatewith!! export deleteall, delete @@ -193,6 +193,8 @@ function Base.last(m::Type{T}; order = SQLOrder(pk(m), :desc))::Union{Nothing,T} find(m, SQLQuery(order = order, limit = 1)) |> onereduce end +function count end + function Base.count(m::Type{T}; where_conditions...)::Int where {T<:AbstractModel} SearchLight.count(m, SQLQuery(where = [SQLWhereExpression("$(SQLColumn(x)) = ?", y) for (x,y) in where_conditions])) end