title: AWS Lambda with python sqlite3
body: <p>I am uploading a .zip file to AWS Lambda which contains a .py file. After uploading I am getting an error like this:</p>
  <pre><code>attempt to write a readonly database
  [ERROR] OperationalError: table &quot;AuData1&quot; already exists
  Traceback (most recent call last):
    File &quot;/var/task/lambda_function.py&quot;, line 15, in lambda_handler
      cur.execute('''END RequestId: f5539447-a6d8-47ed-b415-5e2971923357
  </code></pre>
  <p>The code for .py file is:</p>
  <pre><code>def lambda_handler(event,context):
      try:
          conn = sqlite3.connect('SearchResultData.db')
          cur = conn.cursor()
          cur.execute('DROP TABLE IF EXISTS AuData1')
      except Exception as e:
          print(e)
  
      cur.execute('''
      CREATE TABLE &quot;AuData1&quot; (
  .......
  </code></pre>
  <p>So basically the sqlite database present in the folder contains this table 'AuData1' but I want it to drop that and create a new one. However the database is not accessible as it says &quot;<strong>readonly database</strong>&quot;.
  Please help if any solution available. Thank you in advance</p>