Database stuff for the library.