View Source Bind.QueryBuilder (bind v0.1.1)

Summary

Functions

Link to this function

add_limit_query(query, params)

View Source
Link to this function

add_offset_query(query, params)

View Source
Link to this function

build_sort_query(params)

View Source
Link to this function

build_where_query(params)

View Source
Link to this function

constraint(field, constraint, value)

View Source

Parses a constraint and returns a dynamic query fragment.

Parameters

  • field: The field to apply the constraint to.
  • constraint: The type of constraint (e.g., "eq", "gte").
  • value: The value to compare the field against.

Examples

> Bind.Parse.constraint(:name, "eq", "Alice")
dynamic([r], r.name == ^"Alice")

> Bind.Parse.constraint(:age, "gte", 30)
dynamic([r], r.age > ^30)
Link to this function

validate_where_query(params)

View Source