tcldb is a database abstraction layer
WK also writes that tcldb includes a record and replay system for Tcl/Tk: "... all that is needed to do this (and do fancy widget matching). See ... http://dqsoftware.cvs.sourceforge.net/dqsoftware/tcldb/lib/tcldb/tests/ to have a quick tour on how it works. Look for tcldb::testwidget."