replacing raw DB commands to trySelect, tryInsert, etc.