Skip to content

Storage

Kevin Weng edited this page Apr 12, 2020 · 1 revision

Convo currently uses a SQLite3 database which doesn't require a server. The database is simply stored in a DB file in db. You can interact with the database (say test.db) if you have sqlite3 installed by running

sqlite3 test.db

To interact with the database in Python, Convo uses Flask-SQLAlchemy, which provides an interface on top of the database so you don't have to write SQL queries. To setup a local database for Convo, check out db/README.md.

There are currently two tables in the database that are defined by db.Models in db_manage.py

  1. user - contains all users connected to Convo - defined by User
  2. program - contains all procedures created in Convo - defined by Program

To store Procedure objects in the database, Convo essentially transforms the object into a dictionary of values before encoding it into JSON and storing the JSON string in the database. The opposite happens when retrieving a procedure from the database.

Clone this wiki locally