opendcs / rest_api

Rest API that serves OpenDCS database objects as JSON
Apache License 2.0
1 stars 3 forks source link

Move database type along with relevant metadata to the database schema #191

Open adamkorynta opened 1 month ago

adamkorynta commented 1 month ago

Component to be refactored The REST API currently requires configuration inputs to determine what database it is connecting to.

Purpose of refactoring Less configuration for deployment.

Proposed method Add information to the database schema which could tell the REST API which database (oracle/postgresql/etc) and which type (CWMS/OpenTSDB/HDB/etc) instead of needing to add additional configuration parameters.

Additional context Brought up in PR: https://github.com/opendcs/rest_api/pull/186#discussion_r1773879778

MikeNeilson commented 1 month ago

well, hard to put the database engine in a query and query it without knowing, but shouldn't be too much of an issue to keep the table simple enough it doesn't really matter and we can get the "type".

We definitely need to get away from the isOracle/PG, isCwms/HDB/etc checks over time as 1. it just makes the code easier to read, and 2. kinda benefits the project to let additional usages slurp in the concept with OpenDCS needing to know about them.