[db] added custom SQL query support