db connection for graphs