# Saving JSON in Sqlite3 (Python)

**URL:** <https://forum.codeselfstudy.com/t/saving-json-in-sqlite3-python/2707>\
**Category:** General Discussion\
**Tags:** sqlite, python\
**Created:** [August 20, 2021, 10:21pm UTC](https://forum.codeselfstudy.com/t/saving-json-in-sqlite3-python/2707 "2021-08-20T22:21:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Post date:** [August 20, 2021, 10:21pm UTC](https://forum.codeselfstudy.com/t/saving-json-in-sqlite3-python/2707/1 "2021-08-20T22:21:47Z")

</div>

Today I’m working on a Django site that is connected to slqite3 just to sketch out some ideas. I’m using [`JSONField`](https://docs.djangoproject.com/en/3.2/ref/models/fields/#django.db.models.JSONField) for dumping some unstructured data into the database.

The Django docs [mentioned](https://code.djangoproject.com/wiki/JSON1Extension) that JSON is supported in sqlite3. Here’s how to check if it’s already set up:

```nohighlight
>>> 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](https://www.sqlite.org/inmemorydb.html) is also interesting.

More info here:  
[https://docs.python.org/3/library/sqlite3.html](https://docs.python.org/3/library/sqlite3.html)

---

<div class="post-metadata">

**Author:** ![Josh](https://forum.codeselfstudy.com/user_avatar/forum.codeselfstudy.com/josh/32/4_2.png) [@Josh](https://forum.codeselfstudy.com/u/Josh)\
**Post date:** [August 20, 2021, 10:25pm UTC](https://forum.codeselfstudy.com/t/saving-json-in-sqlite3-python/2707/2 "2021-08-20T22:25:31Z")

</div>

While reading about sqlite, I stumbled across another project by the same developer:  
[https://unqlite.org/](https://unqlite.org/)

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