News for hackers. Stuff that matters.
Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust by mborch on Saturday February 06, 2016 @03:50AM (#11047041)
You can use a CASE-statement for each possible filter and apply it only if the filter value(s) are non-trivial.

    -- Parameter :filter
    --
    AND CASE WHEN :filter IS NOT NULL THEN
        table.column = :filter
    ELSE TRUE END
This has zero cost in the case where :filter is unset.
Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust by barrkel on Saturday February 06, 2016 @04:21AM (#11047100)
The filters are predicates, not values.