Sha256: e42ffec7d67b6b2be49881dda9725009b289a30f2eefb04dc01c997e701bf112

Contents?: true

Size: 634 Bytes

Versions: 1

Compression:

Stored size: 634 Bytes

Contents

# Restrict

Predicate-based filtering

## Signature

restrict(operand: Relation, predicate: Predicate) -> Relation

## Examples

restrict(suppliers, city: 'Paris', status: 20)

restrict(suppliers, eq(city: 'Paris') & gt(:status, 20))

restrict(suppliers, ->(t){ t.city == 'Paris' and t.status > 20 })

## Description

Computes a relation as a subset of `operand` tuples for which a tuple
predicate evaluates to TRUE.

## Implementation notes

As of current Alf version, native predicates (through ruby `Proc` objects)
cannot be optimized nor compiled to SQL. The use of predicate factories
(`eq`, `gt`, etc.) is strongly recommanded.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alf-shell-0.15.0 doc/txt/restrict.txt