1
0
Fork
You've already forked nutrition
0
No description
  • Go 92.8%
  • Makefile 7.2%
2025年03月22日 15:45:11 -07:00
custom Remove recipe column from nutrition_data and create a recipe table. The original intent had been to allow using recipes as nutrient sources, but I'm worried this introduces too much complexity with regard to keeping things synced with the YAML sources. Punting on the problem for now. 2025年03月12日 21:56:58 -07:00
db Remove recipe column from nutrition_data and create a recipe table. The original intent had been to allow using recipes as nutrient sources, but I'm worried this introduces too much complexity with regard to keeping things synced with the YAML sources. Punting on the problem for now. 2025年03月12日 21:56:58 -07:00
usda-branded-foods-db Fix build of branded food database and rebuild SQL schema to support full text searches on unit, tag, and nutrition data descriptions. 2023年06月14日 17:33:59 -07:00
usda-fndds-db Correct the documentation. 2023年05月12日 10:39:26 -07:00
usda-sr-legacy-db Correct the documentation. 2023年05月12日 10:39:26 -07:00
.gitignore Initial commit 2023年05月11日 22:40:29 -07:00
codegen.go Remove unnecessary concatenation. 2025年03月22日 15:45:11 -07:00
constants.go Add way to get a label string from a struct field's name. 2023年05月17日 18:43:22 -07:00
go.mod Use GORM and add some code generation to support that. 2023年05月15日 13:08:59 -07:00
go.sum Use GORM and add some code generation to support that. 2023年05月15日 13:08:59 -07:00
gormModels.go Add virtual tables for faster text searching, in support of providing autocomplete suggestions while editing recipes. 2023年06月12日 14:26:35 -07:00
LICENSE Initial commit 2023年05月11日 22:40:29 -07:00
Makefile Use GORM and add some code generation to support that. 2023年05月15日 13:08:59 -07:00
README.gmi A little more clarifying verbiage in README 2023年05月12日 13:26:20 -07:00
README.lml A little more clarifying verbiage in README 2023年05月12日 13:26:20 -07:00
README.md A little more clarifying verbiage in README 2023年05月12日 13:26:20 -07:00

Nutrition Data

In my quest to make a meal planning program, one of the biggest obstacles has proven to be gathering the necessary data and rendering it useful. This repository holds some of the artifacts of that effort.

Each subdirectory has its own makefile for retrieving nutrition data and putting it into an SQLite database. Most of them also have their own READMEs describing the data and the rationale behind including it.

The SQLite code generated by the Go module in the db subdirectory pulls from the databases compiled in the other subdirectories to create the SQLite database meant to be used with the other parts of the project. If there is a primary "deliverable" here, it's the resulting nutrition.db file. It must be built last due to its dependency on the other databases.

Because of the large number of columns involved, main.go in the db subdirectory dynamically renders the contents of nutrition.sql from the columns maps in constants.go. The nutrition.sql file should not need to be rebuilt unless you want to change some aspect of nutrition.db's schema or the process by which it imports data from the USDA databases generated in the usda-* subdirectories.

The makefile in the current directory does not build the databases in the subdirectories. It only builds README.md and README.gmi from the README.lml source file.