Missing docstring for UnsupportedException. Check Documenter's build log for details.
Missing docstring for DataFrames.DataFrame. Check Documenter's build log for details.
Base.one — Function
one(x)
one(T::type)Return a multiplicative identity for x: a value such that one(x)*x == x*one(x) == x. Alternatively one(T) can take a type T, in which case one returns a multiplicative identity for any x of type T.
If possible, one(x) returns a value of the same type as x, and one(T) returns a value of type T. However, this may not be the case for types representing dimensionful quantities (e.g. time in days), since the multiplicative identity must be dimensionless. In that case, one(x) should return an identity value of the same precision (and shape, for matrices) as x.
If you want a quantity that is of the same type as x, or of type T, even if x is dimensionful, use oneunit instead.
See also the identity function, and I in LinearAlgebra for the identity matrix.
Examples
julia> one(3.7)
1.0
julia> one(Int)
1
julia> import Dates; one(Dates.Day(1))
1Base.all — Function
all(itr) -> BoolTest whether all elements of a boolean collection are true, returning false as soon as the first false value in itr is encountered (short-circuiting). To short-circuit on true, use any.
If the input contains missing values, return missing if all non-missing values are true (or equivalently, if the input contains no false value), following three-valued logic.
See also: all!, any, count, &, , &&, allunique.
Examples
julia> a = [true,false,false,true]
4-element Vector{Bool}:
1
0
0
1
julia> all(a)
false
julia> all((println(i); v) for (i, v) in enumerate(a))
1
2
false
julia> all([missing, false])
false
julia> all([true, missing])
missingall(p, itr) -> BoolDetermine whether predicate p returns true for all elements of itr, returning false as soon as the first item in itr for which p returns false is encountered (short-circuiting). To short-circuit on true, use any.
If the input contains missing values, return missing if all non-missing values are true (or equivalently, if the input contains no false value), following three-valued logic.
Examples
julia> all(i->(4<=i<=6), [4,5,6])
true
julia> all(i -> (println(i); i < 3), 1:10)
1
2
3
false
julia> all(i -> i > 0, [1, missing])
missing
julia> all(i -> i > 0, [-1, missing])
false
julia> all(i -> i > 0, [1, 2])
trueall(A; dims)Test whether all values along the given dimensions of an array are true.
Examples
julia> A = [true false; true true]
2×2 Matrix{Bool}:
1 0
1 1
julia> all(A, dims=1)
1×2 Matrix{Bool}:
1 0
julia> all(A, dims=2)
2×1 Matrix{Bool}:
0
1all(p, A; dims)Determine whether predicate p returns true for all elements along the given dimensions of an array.
Examples
julia> A = [1 -1; 2 2]
2×2 Matrix{Int64}:
1 -1
2 2
julia> all(i -> i > 0, A, dims=1)
1×2 Matrix{Bool}:
1 0
julia> all(i -> i > 0, A, dims=2)
2×1 Matrix{Bool}:
0
1SearchLight.updatewith! — Function
updatewith!(m::T, w::T)::T where {T<:AbstractModel}Update the model m with the values from w and return the updated model.
Examples
julia> using UserApp.User
julia> SearchLight.updatewith!(user, Dict("name" => "John Doe", "email" => "foo@bar.com"))
julia> save!(user)SearchLight.updatewith — Function
updatewith!(m::T, w::T)::T where {T<:AbstractModel}Update the model m with the values from w and return the updated model.
Examples
julia> using UserApp.User
julia> SearchLight.updatewith!(user, Dict("name" => "John Doe", "email" => "foo@bar.com"))
julia> save!(user)Missing docstring for updateby_or_create. Check Documenter's build log for details.
SearchLight.update_or_create — Function
update_or_create(m::T; ignore = Symbol[], skip_update = false, filters...)::T where {T<:AbstractModel}Examples
julia>Missing docstring for findone_or_create. Check Documenter's build log for details.
SearchLight.to_models — Function
to_models(m::Type{T}, df::DataFrames.DataFrame)::Vector{T} where {T<:AbstractModel}Return an array of type Model
Examples
julia> DataFrame(Stat, SQLWhereExpression("date >= ? AND date <= ?", startdate, enddate), order=["stats.date"])
8160×9 DataFrame
Row │ stats_id stats_package_uuid stats_package_name stats_status stats_region stats_date stats_request_count stats_year stats_month
│ Int64 String String Int64 String String Int64 Int64 String
──────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 1 00000000-1111-2222-3333-44444444… REPLTreeViews 200 cn-northeast 2021-11-25 1 2021 2021-11
2 │ 17 00701ae9-d1dc-5365-b64a-a3a3ebf5… BioAlignments 200 au 2021-11-25 1 2021 2021-11
3 │ 217 00701ae9-d1dc-5365-b64a-a3a3ebf5… BioAlignments 200 us-west 2021-11-25 1 2021 2021-11
4 │ 314 009559a3-9522-5dbb-924b-0b6ed2b2… XGBoost 200 cn-northeast 2021-11-25 1 2021 2021-11
5 │ 406 009559a3-9522-5dbb-924b-0b6ed2b2… XGBoost 200 eu-central 2021-11-25 5 2021 2021-11
6 │ 461 009559a3-9522-5dbb-924b-0b6ed2b2… XGBoost 200 sa 2021-11-25 1 2021 2021-11
⋮
8160 │ 623498 fff527a3-8410-504e-9ca3-60d5e79b… SimpleANOVA 200 eu-central 2021-11-25 1 2021 2021-11
julia> SearchLight.to_models(Stat, DataFrame(Stat, SQLWhereExpression("date >= ? AND date <= ?", startdate, enddate), order=["stats.date"]))
8160-element Vector{Stat}:
Stat
| KEY | VALUE |
|----------------------|--------------------------------------|
| date::Date | 2021-11-25 |
| id::DbId | 1 |
| month::String | 2021-11 |
| package_name::String | REPLTreeViews |
| package_uuid::String | 00000000-1111-2222-3333-444444444444 |
| region::String | cn-northeast |
| request_count::Int64 | 1 |
| status::Int64 | 200 |
| year::Int64 | 2021 |
⋮
Stat
| KEY | VALUE |
|----------------------|--------------------------------------|
| date::Date | 2021-11-25 |
| id::DbId | 623498 |
| month::String | 2021-11 |
| package_name::String | SimpleANOVA |
| package_uuid::String | fff527a3-8410-504e-9ca3-60d5e79bb1e4 |
| region::String | eu-central |
| request_count::Int64 | 1 |
| status::Int64 | 200 |
| year::Int64 | 2021 |SearchLight.columns_from_joins — Function
columnsfromjoins(joins::Vector{SQLJoin})::Vector{SQLColumn}
Extracts columns from joins param and adds to be used for the SELECT part
Missing docstring for column_data_to_column_name. Check Documenter's build log for details.
Missing docstring for prepare_column_name. Check Documenter's build log for details.
Missing docstring for columns_names_by_table. Check Documenter's build log for details.
Missing docstring for dataframes_by_table. Check Documenter's build log for details.
Missing docstring for column_field_name. Check Documenter's build log for details.
Missing docstring for persistable_fields. Check Documenter's build log for details.
Missing docstring for is_fully_qualified. Check Documenter's build log for details.
Missing docstring for from_fully_qualified. Check Documenter's build log for details.
Missing docstring for strip_module_name. Check Documenter's build log for details.
Missing docstring for to_fully_qualified. Check Documenter's build log for details.
Missing docstring for to_sql_column_names. Check Documenter's build log for details.
Missing docstring for to_sql_column_name. Check Documenter's build log for details.
Missing docstring for to_fully_qualified_sql_column_names. Check Documenter's build log for details.
Missing docstring for fo_fully_qualified_sql_column_name. Check Documenter's build log for details.
Missing docstring for from_literal_column_name. Check Documenter's build log for details.
Missing docstring for update_query_part. Check Documenter's build log for details.
SearchLight.escape_column_name — Function
escape_column_name(c::SQLColumn) :: SQLColumn
escape_column_name(s::String)Sanitizes input to be use as column names in SQL queries.
SearchLight.escape_value — Function
escape_value(i::SQLInput)Sanitizes input to be used as values in SQL queries.
SearchLight.add_quotes — Function
add_quotes(str::String) :: StringAdds quotes around str and escapes any previously existing quotes.
SearchLight.strip_quotes — Function
strip_quotes(str::String) :: StringUnquotes str.
SearchLight.isquoted — Function
isquoted(str::String) :: BoolChecks weather or not str is quoted.
Core.NamedTuple — Type
NamedTupleNamedTuples are, as their name suggests, named Tuples. That is, they're a tuple-like collection of values, where each entry has a unique name, represented as a Symbol. Like Tuples, NamedTuples are immutable; neither the names nor the values can be modified in place after construction.
Accessing the value associated with a name in a named tuple can be done using field access syntax, e.g. x.a, or using getindex, e.g. x[:a] or x[(:a, :b)]. A tuple of the names can be obtained using keys, and a tuple of the values can be obtained using values.
Iteration over NamedTuples produces the values without the names. (See example below.) To iterate over the name-value pairs, use the pairs function.
The @NamedTuple macro can be used for conveniently declaring NamedTuple types.
Examples
julia> x = (a=1, b=2)
(a = 1, b = 2)
julia> x.a
1
julia> x[:a]
1
julia> x[(:a,)]
(a = 1,)
julia> keys(x)
(:a, :b)
julia> values(x)
(1, 2)
julia> collect(x)
2-element Vector{Int64}:
1
2
julia> collect(pairs(x))
2-element Vector{Pair{Symbol, Int64}}:
:a => 1
:b => 2In a similar fashion as to how one can define keyword arguments programmatically, a named tuple can be created by giving a pair name::Symbol => value or splatting an iterator yielding such pairs after a semicolon inside a tuple literal:
julia> (; :a => 1)
(a = 1,)
julia> keys = (:a, :b, :c); values = (1, 2, 3);
julia> (; zip(keys, values)...)
(a = 1, b = 2, c = 3)As in keyword arguments, identifiers and dot expressions imply names:
julia> x = 0
0
julia> t = (; x)
(x = 0,)
julia> (; t.x)
(x = 0,)