title: How to enable access control in SQLite?
body: <p>We have an application which uses SQLite as an embedded RDBMS. Initially the application was meant for a single machine and single user. But with time the scope of the project has expanded. Now one of the feature that we need is a <strong><em><code>Fine grained access control.</code></em></strong> </p>
  
  <p>Now as mentioned on the <a href="http://www.sqlite.org/whentouse.html" rel="nofollow noreferrer">Appropriate Uses For SQLite</a></p>
  
  <blockquote>
    <p>... SQLite has had to sacrifice other
    characteristics that some people find useful, such as high
    concurrency, <strong>fine-grained access control</strong>, a rich set of built-in
    functions...</p>
  </blockquote>
  
  <p>And in this <a href="http://www.sitepoint.com/forums/showthread.php?613707-SQLite-How-to-create-users-and-give-permission" rel="nofollow noreferrer">forum post</a></p>
  
  <blockquote>
    <p>sqlite doesn't have usernames and passwords. you can't secure the data
    files in that manner.</p>
  </blockquote>
  
  <p>So, from the above it is very clear that access control is not available. And in a way it makes sense as it is mostly used in mobile applications, browsers or where ever an embedded db is required.</p>
  
  <p>As per this <a href="https://stackoverflow.com/questions/1381264/password-protect-a-sqlite-db-is-it-possible">SO post</a> it is possible to encrypt the database. But to my best of knowledge I can not describe it as <code>fine grained access control</code> as the SQLite database is bounded to a single encryption key. Also, I can't have multiple users and with different access levels.</p>
  
  <p><strong><code>Now my question are:</code></strong></p>
  
  <ol>
  <li>Is it possible to enable access control in SQLite in anyway? (I may have answered my question, but still, for my inner satisfaction I am asking this one :) )</li>
  <li>Is my understanding of <code>fine grained access control</code> related to encryption is correct?</li>
  <li>Lets say if I use encryption for a single machine and single user then what are the drawbacks of it over a real <code>fine grained access control</code>? (performance might be one of them as we have to decrypt it for every connection.. not sure)</li>
  </ol>
  
  <p><strong><code>Some Useful Information</code></strong></p>
  
  <ol>
  <li>We are using the latest release of SQLite.</li>
  <li>The SQLite is embedded as part of source code. </li>
  <li>In its full capacity we can expect a database of size 1 GB or around.</li>
  </ol>
  
  <p><strong>Note:</strong> I know that it good to use any other RDBMS where access control is available, but question are very specific to <strong>SQLite</strong>. Please answer them in that light. Thanks.</p>