tcldb , by Wojciech Kocjan, is a database abstraction layer
WK:
It may not be the most lightweight interface, but it seems to do the trick. It also (which IMHO is more important) handles some differences between databases (like FORMAT_DATE vs TO_CHAR, NOW vs CURRENT_* and so on).
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."