Search⌘ K

Inspecting the Usage Database

Explore how to inspect and populate the usages table in a database using SQL and SQLAlchemy ORM. Understand the data model setup in SQLite and PostgreSQL, and visualize database growth after inserting data. This lesson helps you manage backend data effectively for web applications.

Populating the usages table with data

Following are the commands necessary for putting the data in the usages table.

Shell
PS C:> wget https://github.com/socratecha/frapbook-v1.0-langman/raw/master/data/usages.csv
PS C:> export FLASK_ENV=dev_lite
PS C:> export FLASK_APP=server.prepare_orm
PS C:> export LC_ALL=C.UTF-8 && export LANG=C.UTF-8
PS C:> pipenv run flask init-db
Adding 5760 rows to Usage tables

Note that in Mac and Linux FLASK_ENV is set ...