Handbook
Glossary
count-tuples ( query/tuple -- n )
High-level tuple/database integration
ยป
High-level tuple/database words
Prev:
select-tuples ( query/tuple -- tuples )
Vocabulary
db
.
tuples
Inputs
query/tuple
a
tuple
Outputs
n
an
integer
Word description
Returns the number of items that would be returned if the query were a select query. Counting the tuples with this word is more efficient than calling
length
on the result of
select-tuples
.
See also
each-tuple
,
select-tuple
,
select-tuples
Definition
USING:
accessors
db.tuples.private
kernel
math.parser
sequences
;
IN:
db.tuples
:
count-tuples
( query/tuple -- n )
>query
[
tuple>>
]
[
<count-statement>
]
bi
do-count
[
first
string>number
]
map
dup
length
1
=
[
first
]
when
;