🦖 Gregory Eakin
This is an experiment in configuring an existing USDA Nutrition Database in Entity Framework Core.
- Unzip the Full Version of the SR28 ASCII file format into the data folder.
- Unzip the patch file (May 2016) into the data2 folder. Overwrite the DATASRCLN.txt and sr28_doc.pdf
cd ~/source/NutrishSr28.EF.Core
curl https://www.ars.usda.gov/ARSUserFiles/80400535/DATA/SR/sr28/dnload/sr28asc.zip --output sr28asc.zip
mkdir data/
unzip sr28asc.zip -d data/
SqllocalDB i
SqllocalDB create "SR28" -s
sqlcmd -S "(localdb)\SR28" -Q "CREATE DATABASE Nutrish"
cd DBSetup
dotnet ef database update
dotnet run
cd ../DBSetup.Tests
dotnet test
cd DBSetup
rm migrations/*
dotnet ef migrations remove
dotnet ef migrations add Postgresql
dotnet ef database update
dotnet run
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
- Entity Framework Core
- SQL Server
- SQL Server LocalDB
- SQL Server Management Sdutio
- PostgreSQL
- pgAdmin
- CsvHelper
- Visual Studio
- ReSharper
- Unit Tests
- Git Extensions
docker exec -it postgres-db-1 psql -U greg -c "CREATE database SR28;"
docker exec -it postgres-db-1 psql -U greg -c "CREATE USER docker;"
docker exec -it postgres-db-1 psql -U greg -c "ALTER USER docker WITH PASSWORD 'secret';"
docker exec -it postgres-db-1 psql -U greg -c "GRANT ALL PRIVILEGES ON DATABASE SR28 TO docker;"
docker exec -it postgres-db-1 psql -U greg -c "ALTER USER docker WITH SUPERUSER;"