[work-in-progress] First pass at attempting to pull login values from env vars #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP but it should fundamentally work. I haven't tested anything tho, I need to get back to writing something due really soon... 😅
Remaining issues:
Use some sort of object storage (e.g. S3) and send the Sqlite3 database back and forth over it (assuming Heroku even uses us let Sqlite as a dependency; it really doesn't like it) between process boots.
Replace Sqlite3 with just flatfile storage — given the database is mainly just used to build the corpora and it doesn't seem to do much with any column other than the content one, it might be easier to just ignore all the metadata entirely and dump all the content into a newline-delimited text file. Probably a bit more performant too. Could ostensibly use CSV if data like toot ID is necessary.
Use Postgres when deployed on Heroku. Syntax is pretty similar. We could use an ORM like peewee or pony to prevent having to do raw SQL calls in code and be able to use the same code to talk to either Python or Sqlite. Probably the easiest to provision. This increasingly feels like the way to go to add PaaS support while maintaining backwards compatibility for people who run things locally.
Uhhhh really sorry I have pylint set to autoformat to PEP8 and so this diff is really hard to read 😓