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_true is true. (SQL: col is true)
  • [x] is_not_true is not true. (SQL: col is false)
  • [x] is_false is false. (SQL: col is false)
  • [x] is_not_false is 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] in contains. (SQL: col in ['1024', '1025'])
  • [x] not_in not contains. (SQL: col not in ['1024', '1025'])
  • [x] start_with start with. (SQL: col like 'value%')
  • [x] not_start_with not start with. (SQL: col not like 'value%')
  • [x] end_with end 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

handle_expr(search_type, attribute, values, binding_keys \\ [:query])

Builds a dynamic expression for the given search type, attribute and values.