Code Self Study Forum

Saving JSON in Sqlite3 (Python)

Today I’m working on a Django site that is connected to slqite3 just to sketch out some ideas. I’m using JSONField for dumping some unstructured data into the database.

The Django docs mentioned that JSON is supported in sqlite3. Here’s how to check if it’s already set up:

>>> import sqlite3
>>> conn = sqlite3.connect(":memory:")
>>> cursor = conn.cursor()
>>> cursor.execute('SELECT JSON(\'{"a": "b"}\')')

I thought it was interesting way to quickly dump JSON into storage without having to set up something larger, like Postgres or Mongo. The :memory: option is also interesting.

More info here:

While reading about sqlite, I stumbled across another project by the same developer:

It looks like it might be the equivalent of sqlite for noSQL.