src: added database handling functions