Sha256: d051ee20e6a490585916268a1b15527ff7f1b429b285942de7d9fe69ef8c1aec

Contents?: true

Size: 751 Bytes

Versions: 3

Compression:

Stored size: 751 Bytes

Contents

.TH Restrict
.PP
Predicate\-based filtering
.SH Signature
.PP
.RS
.nf
restrict(operand: Relation, predicate: Predicate) \-> Relation
.fi
.RE
.SH Examples
.PP
.RS
.nf
restrict(suppliers, city: 'Paris', status: 20)
.fi
.RE
.PP
.RS
.nf
restrict(suppliers, eq(city: 'Paris') & gt(:status, 20))
.fi
.RE
.PP
.RS
.nf
restrict(suppliers, \->(t){ t.city == 'Paris' and t.status > 20 })
.fi
.RE
.SH Description
.PP
Computes a relation as a subset of \fB\fCoperand\fR tuples for which a tuple
predicate evaluates to TRUE.
.SH Implementation notes
.PP
As of current Alf version, native predicates (through ruby \fB\fCProc\fR objects)
cannot be optimized nor compiled to SQL. The use of predicate factories
(\fB\fCeq\fR, \fB\fCgt\fR, etc.) is strongly recommended.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alf-shell-0.16.3 doc/man/restrict.man
alf-shell-0.16.2 doc/man/restrict.man
alf-shell-0.16.1 doc/man/restrict.man