See nt-sqlite: https://github.com/nutratech/nt-sqlite
+
Building the database
#########################
bash setup.sh
python3 process.py
+
3. If you are committing database changes, add a line to
:code:`sql/version.csv` (e.g. :code:`id=3` is the latest in this case).
| 3 | 0.0.2 | Thu 06 Aug 2020 09:21:39 AM EDT |
+-----+----------+-----------------------------------+
-4. i. (Optional) Enforce foreign keys with your ``~/.sqliterc`` file,
+
+4. i. *(Optional)* Enforce FKs by copying this to your ``~/.sqliterc`` file.
.. code-block:: text
.mode column
PRAGMA foreign_keys = 1;
-4. ii. Create the database with
+4. ii. Create the database.
.. code-block:: bash
make build
-5. Verify the tables (inside an SQL shell: :code:`sqlite3 sql/usda.sqlite3`),
+5. Verify the tables.
.. code-block:: sql
- .tables
+ make test
- SELECT * FROM nutr_def WHERE id=328;
- SELECT long_desc FROM food_des WHERE id=9050;
- SELECT * FROM version;
-
- .exit
6. If everything looks good, upload compressed
:code:`dist/nutra-X.X.X.db.tar.xz` file to binary host.
make deploy/upload
+
Tables (Relational Design)
##########################