title: Storing JSON into database in python
body: <p>I'm fetching some data from an API on regular interval and wants to store the JSON data into database to access and use later.</p>
  
  <p>From API, I get data in this sample each time:</p>
  
  <pre><code>'{"data": {"cursor": null, "files": {"nodes": [{u'code': u'BOPhmYQg5Vm', u'date': 1482244678,u'counts': 2, u'id': u'1409492981312099686'}, {u'code': u'g5VmBOPhmYQ', u'date': 1482244678,u'counts': 5, u'id': u'1209968614094929813'}]}}}'
  </code></pre>
  
  <p>I can <code>json_data = json.loads(above_data)</code> and then fetch <code>nodes</code> as <code>nodes_data = json_data["data"]["files"]["nodes"]</code> which gives a list of <code>nodes</code>.</p>
  
  <p>I want to store this <code>nodes</code> data into DB column <code>data = Column(db.Text)</code> of <code>Text</code> type. Each time there are going to be 10-15 values in nodes list. </p>
  
  <p>How do I store? There are multiple <code>nodes</code> and I need it in a way that in future I can append/add more <code>nodes</code> to already available <code>data</code> column in my db.</p>
  
  <p>While I would like to do <code>json.loads(db_data_col)</code> so that I get valid json and can loop over all of <code>nodes</code> to get internal data and use later.</p>
  
  <p>I'm confused on how to store in db and access later in valid json format.</p>
  
  <p><strong>Edit 1:</strong> Using Sqlite for testing. Can use PostgresSQL in future. <code>Text</code> type of column is main point.</p>