Add the support for DB

Add the query, update, add support for DB