Database connection and lite model functions