diesel::pg::expression::dsl

Function lower_inf

Source
pub fn lower_inf<R: MultirangeOrRangeMaybeNullable + SingleValue + MaybeNullableValue<Bool>, range>(
    range: range,
) -> lower_inf<R, range>
where range: AsExpression<R>,
Available on crate feature postgres_backend only.
Expand description

Returns true if the range’s lower bound is unbounded

§Example

let int = diesel::select(lower_inf::<Range<Integer>,  _>(1..5)).get_result::<bool>(connection)?;
assert_eq!(false, int);

let int = diesel::select(lower_inf::<Range<Integer>,  _>(..5)).get_result::<bool>(connection)?;
assert_eq!(true, int);

let int = diesel::select(lower_inf::<Nullable<Range<Integer>>, _>(None::<std::ops::Range<i32>>)).get_result::<Option<bool>>(connection)?;
assert_eq!(None, int);

let int = diesel::select(lower_inf::<Multirange<Integer>, _>(vec![5..7])).get_result::<bool>(connection)?;
assert_eq!(false, int);