Add ReadOrCreateDatabase logic