Properly db init before first resolve of first view

The thing is I need to be able to load in my first state view resolve, data from sqlite db, but i dont know where to call the openDB before to achieve this, can anyone help me?