-************
- nt-sqlite3
-************
+***********
+ nt-sqlite
+***********
Python, SQL and CSV files for setting up portable SQL database.
Pypi page: https://pypi.org/project/nutra
+
Building the database
#########################
-1. Install ``access2csv`` dependency, :code:`git submodule update --init`
+1. Install ``access2csv`` dependency,
+
+.. code-block:: bash
+
+ git submodule update --init
2. Download database and process into CSV files,
bash setup.sh
python3 process.py
-3. If you are committing changes, add a line to :code:`nt_ver.csv``, e.g. :code:`id=3` is new
+3. If you are committing database changes, add a line to :code:`nt_ver.csv` (e.g. :code:`id=3` is new),
+-----+----------+-----------------------------------+
| id | version | created |
cd ../sql
sqlite3 nutra.db
-NOTE: FOLLOW STEP 5 FROM INSIDE THE SQL SHELL
+NOTE: FOLLOW STEPS 5 and 6 FROM INSIDE THE SQL SHELL
5. Create the tables, import the data, and save:
.read import.sql
.exit
-6. Verify the tables, again inside :code:`sqlite nutra.db`,
+6. Verify the tables (again inside the SQL shell :code:`sqlite nutra.db`),
.. code-block:: sql
7. If everything looks good, compress into :code:`nutra-X.X.X.db.tar.xz` and upload to binary host.
+
Tables (Relational Design)
##########################
-See :code:`data/tables.sql` for details.
+See :code:`sql/tables.sql` for details.
This is frequently updated, see :code:`docs/` for more info.
+-- nt-sqlite, an sqlite3 database for nutratracker clients
+-- Copyright (C) 2020 Shane Jaroch <nutratracker@gmail.com>
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <https://www.gnu.org/licenses/>.
+
.mode csv
.import '| tail -n +2 nt_ver.csv' nt_ver