#-------------------------------------------------------------------------
# Process command line arguments.
#
set O(nterm) 0
set O(segments) 0
if usage
foreach a
set database
set tbl
#-------------------------------------------------------------------------
# Count the number of terms in each segment of fts5 table $tbl. Store the
# counts in the array variable in the parent context named by parameter
# $arrayname, indexed by segment-id. Example:
#
# count_terms fts_tbl A
# foreach {k v} [array get A] { puts "segid=$k nTerm=$v" }
#
#-------------------------------------------------------------------------
# Start of main program.
#
sqlite3 db $database
catch
if
db eval "SELECT fts5_decode(rowid, block) AS d FROM ${tbl}_data WHERE id=10"
if