title: SQLite recursive query to return file path
body: <p>At the moment I'm developing an application which has to store a file hierarchy (folders and files are not distinguished) in a database. For this  created following table:</p>
  
  <pre><code>tbl_files
  ----------------------------------
  |   id   |   name   |   parent   |
  ----------------------------------
  </code></pre>
  
  <p>The parent field is a foreign to <code>tbl_files</code> itself. The main directory has the id <code>root</code>. I now want to get the path to a file until the root directory is reached. I thought about to do this with a recursive SQL-Query but I do not know how to "return" the path from the database.</p>
  
  <p>Is a recursive query okay or is it bad practice? And how should I "generate" the path with this query?</p>