ash v1.35.1 Ash.Filter.Runtime View Source

Checks a record to see if it matches a filter statement.

We can't always tell if a record matches a filter statement, and as such this function may return :unknown. Additionally, some expressions wouldn't ever make sense outside of the context of the data layer, and will always be an error. For example, if you used the trigram search features in ash_postgres. That logic would need to be handwritten in Elixir and would need to be a perfect copy of the postgres implementation. That isn't a realistic goal. This generally should not affect anyone using the standard framework features, but if you were to attempt to use this module with a data layer like ash_postgres, certain expressions will behave unpredictably.

Link to this section Summary

Functions

Removes any records that don't match the filter. Automatically side loads if necessary. If there are any ambigious terms in the filter (e.g things that could only be determined by data layer), it is assumed that they are not matches.

Checks if a record matches a filter, side loading any necessary relationships"

Link to this section Functions

Link to this function

filter_matches(api, records, filter)

View Source
Link to this function

filter_matches(api, list, filter, _)

View Source

Removes any records that don't match the filter. Automatically side loads if necessary. If there are any ambigious terms in the filter (e.g things that could only be determined by data layer), it is assumed that they are not matches.

Link to this function

matches(record, expression)

View Source
Link to this function

matches?(api, record, filter)

View Source

Checks if a record matches a filter, side loading any necessary relationships"

If it can't tell, this returns false.