title: How does one export a Room table to a CSV format?
body: <p>I have an app right now that stores data in a Room database using several entities. What I need is to take the contents of a table, convert the data into a CSV format, and then to send that format via email. I have the very last part buttoned down, as it simply involves sending the file through an intent with <code>ACTION_SEND</code>. That's easy.</p>
  
  <p>I understand that I can get the path to the actual database and manipulate that file. However, the designers of Room went to such great lengths to put SQLite into a black box that this seems like a bad idea. </p>
  
  <p>I know that I can also write a query method in one of the DAOs that returns a string in CSV format that can then be turned into a File object. However, that is a lot of work, and I'm not going to waste my time if someone else has done so for me.</p>
  
  <p>So, here's my question: How do I export a Room database table into a CSV formatted string? If there are multiple ways of doing so, is there a preferred way?</p>
  
  <p>Bonus question: Is there any preferred way to back up the entire database?</p>