EctoTurbo.Services.BuildSearchQuery
(EctoTurbo v1.0.0)
View Source
EctoTurbo.Services.BuildSearchQuery is a service module which serves the search hook.
@search_types is a collection of all the valid search_types that come shipped with
EctoTurbo's default search hook. The types are:
- [x]
eq: equal. (SQL:col = 'value') - [x]
not_eq: not equal. (SQL: col != 'value') - [x]
lt: less than. (SQL: col < 1024) - [x]
lteq: less than or equal. (SQL: col <= 1024) - [x]
gt: greater than. (SQL: col > 1024) - [x]
gteq: greater than or equal. (SQL: col >= 1024) - [x]
is_present: not null and not empty. (SQL: col is not null AND col != '') - [x]
is_blank: is null or empty. (SQL: col is null OR col = '') - [x]
is_null: is null or not null (SQL: col is null) - [x]
is_trueis true. (SQL: col is true) - [x]
is_not_trueis not true. (SQL: col is false) - [x]
is_falseis false. (SQL: col is false) - [x]
is_not_falseis true. (SQL: col is true) - [x]
like: contains trem value. (SQL: col like "%value%") - [x]
not_like: not contains value. (SQL: col not like '%value%') - [x]
ilike: contains value in a case insensitive fashion. (SQL: ) - [x]
not_ilike: not contains value in a case insensitive fashion. (SQL: - [x]
incontains. (SQL: col in ['1024', '1025']) - [x]
not_innot contains. (SQL: col not in ['1024', '1025']) - [x]
start_withstart with. (SQL: col like 'value%') - [x]
not_start_withnot start with. (SQL: col not like 'value%') - [x]
end_withend with. (SQL: col like '%value') - [x]
not_end_with(SQL: col not like '%value') - [x]
between: between begin and end. (SQL: begin <= col and col <= end)
Summary
Functions
Builds a dynamic expression for the given search type, attribute and values.
Functions
@spec handle_expr(atom(), EctoTurbo.Hooks.Search.Attribute.t(), list(), [atom()]) :: Ecto.Query.dynamic_expr()
Builds a dynamic expression for the given search type, attribute and values.