reject-tuples ( query/tuple quot: ( tuple -- ? ) -- )
High-level tuple/database integration ยป High-level tuple/database words

Prev:delete-tuples ( tuple -- )
Next:each-tuple ( query/tuple quot: ( tuple -- ) -- )


Vocabulary
db.tuples

Inputs
query/tuplea tuple
quota quotation with stack effect ( tuple -- ? )


Outputs
None

Word description
An SQL query is constructed from the slots of the exemplar tuple that are not f. The quot is applied to each tuple from the database that matches the query, and if it returns a true value, the row is deleted from the database.

The word is equivalent to the following code:
query/tuple select-tuples quot filter [ delete-tuples ] each

The difference is that reject-tuples handles query results one by one, thus avoiding the overhead of allocating the intermediate array of tuples, which select-tuples would do. This is important when processing large amounts of data in limited memory.

Warning
This word will delete your data.


See also
insert-tuple, update-tuple, update-tuples, delete-tuples

Definition