Preliminary database manipulation functions.