microbiomedata / nmdc-runtime

Runtime system for NMDC data management and orchestration
https://microbiomedata.github.io/nmdc-runtime/
Other
4 stars 3 forks source link

Import database names from centralized source #510

Open eecavanna opened 2 months ago

eecavanna commented 2 months ago

Currently, database names are specified via string literals throughout the code base (wherever that database is used). As a result, determining the names of the database this application uses involves "searching (which also involves knowing what to search for)."

image

I propose that all database names be defined (I think of this as "registered") in a centralized place (e.g. a single Python module) and then import-ed from there where needed. That way, determining the names of the database this application uses will involve only checking that one file.

eecavanna commented 2 months ago

Potential "home" for the database name definitions (constants): https://github.com/microbiomedata/nmdc-runtime/blob/main/nmdc_runtime/core/db/Database.py