Test database functions.