A simple version of Seb's db class, for teaching purposes.