Skip to content

GregEakin/NutrishSr28.Net

Repository files navigation

Nutrish Sr28 .Net

🔥 Greg Eakin

This is an experiment in configuring an existing USDA Nutrition Database in NHibernate.

Steps to setup SQL Local DB:

  1. Unzip the Full Version of the SR28 ASCII file format into the data folder.
  2. Unzip the patch file (May 2016) into the data2 folder. Overwrite the DATASRCLN.txt and sr28_doc.pdf
  3. SqllocalDB i
  4. SqllocalDB create "SR28" -s
  5. sqlcmd -S "(localdb)\SR28" -Q "CREATE DATABASE Nutrish"
  6. Run the DBSetup.exe project

Database:

USDA Nutrition Database US Department of Agriculture, Agricultural Research Service. 2016. Nutrient Data Laboratory. USDA National Nutrient Database for Standard Reference, Release 28 (Slightly revised). Version Current: May 2016. http://www.ars.usda.gov/nea/bhnrc/mafcl

Tools:

Author

🔥 Greg Eakin

PostgreSQL DB Stuff

  1. docker exec -it sqlserver-sqldb-1 psql -U sqlserver -c "CREATE database sr28;"
  2. docker exec -it sqlserver-sqldb-1 psql -U sqlserver -c "CREATE USER postgres;"
  3. docker exec -it sqlserver-sqldb-1 psql -U sqlserver -c "ALTER USER postgres WITH PASSWORD 'sqlserver';"
  4. docker exec -it sqlserver-sqldb-1 psql -U sqlserver -c "GRANT ALL PRIVILEGES ON DATABASE sr28 TO postgres;"
  5. docker exec -it sqlserver-sqldb-1 psql -U sqlserver -c "ALTER USER postgres WITH SUPERUSER;"