Database functions partially implemented