2015-04-27 19:21:49 +03:00
|
|
|
|
|
|
|
|
2015-07-09 22:02:19 +03:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Process command line arguments.
|
|
|
|
#
|
2015-04-27 19:21:49 +03:00
|
|
|
proc usage {} {
|
|
|
|
puts stderr "usage: $::argv0 database table"
|
|
|
|
puts stderr ""
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
if {[llength $argv]!=2} usage
|
|
|
|
set database [lindex $argv 0]
|
|
|
|
set tbl [lindex $argv 1]
|
|
|
|
|
2015-07-09 22:02:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
# Start of main program.
|
|
|
|
#
|
2015-04-27 19:21:49 +03:00
|
|
|
sqlite3 db $database
|
2015-07-03 20:14:18 +03:00
|
|
|
catch { load_static_extension db fts5 }
|
2015-04-27 19:21:49 +03:00
|
|
|
|
|
|
|
db eval "SELECT fts5_decode(rowid, block) AS d FROM ${tbl}_data WHERE id=10" {
|
|
|
|
foreach lvl [lrange $d 1 end] {
|
2015-07-09 22:02:19 +03:00
|
|
|
puts [lrange $lvl 0 2]
|
|
|
|
foreach seg [lrange $lvl 3 end] {
|
|
|
|
puts " $seg"
|
|
|
|
}
|
2015-04-27 19:21:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|