From: Shane Jaroch Date: Sat, 8 Aug 2020 14:12:12 +0000 (-0400) Subject: update readme X-Git-Tag: 0.0.3~6 X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=5a952a209084057bf88f3e91c4ab4f200d3bb5e1;p=nutratech%2Fusda-sqlite.git update readme --- diff --git a/README.rst b/README.rst index b2aaef4..6287385 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ -************ - nt-sqlite3 -************ +*********** + nt-sqlite +*********** Python, SQL and CSV files for setting up portable SQL database. @@ -8,10 +8,15 @@ See CLI: https://github.com/nutratech/cli 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, @@ -22,7 +27,7 @@ Building the database 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 | @@ -41,7 +46,7 @@ Building the database 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: @@ -51,7 +56,7 @@ NOTE: FOLLOW STEP 5 FROM INSIDE THE SQL SHELL .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 @@ -63,10 +68,11 @@ NOTE: FOLLOW STEP 5 FROM INSIDE THE SQL SHELL 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. diff --git a/data/setup.sh b/data/setup.sh index c91cea0..233d3b2 100755 --- a/data/setup.sh +++ b/data/setup.sh @@ -38,8 +38,8 @@ curl -L "https://www.ars.usda.gov/ARSUserFiles/80400525/Data/PA/PA02.accdb" -o P # ----------------- # Run access2csv # ----------------- +# git submodule update --init # git clone git@github.com:AccelerationNet/access2csv.git - # cd access2csv # mvn clean install -Dmaven.test.skip=true # the install is handled by command cd ../access2csv diff --git a/sql/import.sql b/sql/import.sql index f7e52b9..df5e149 100644 --- a/sql/import.sql +++ b/sql/import.sql @@ -1,3 +1,19 @@ +-- nt-sqlite, an sqlite3 database for nutratracker clients +-- Copyright (C) 2020 Shane Jaroch +-- +-- 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 . + .mode csv .import '| tail -n +2 nt_ver.csv' nt_ver