ampstore: clean up the DB API a little.