Open abhipaiangle opened 3 years ago
I would like to work in this and long term woudn't it be more beneficial to store the conversations in a database as opposed cookies
That was actually an alternative since it would need extra database storage. I think we can go for it. Since there is a number of messages limit to every conversation, it won't be a problem. Only hoping that PostgreSQL database would be sufficient for this.
So how should the data be stored? The name the message and the message id right?
Display name, channel name, message, time would be sufficient I guess.
The best way to do it would be do convert the dictionary into objects and then store them in the database right?
@sauntheninja2 Yeah. For PostgreSQL databasing, check this code . Follow the raw DB commands like the ones used in the code since the database will be similar. If you want to do it with psql ORM, let me know.
psql ORM I feel will scale better and be easier to read
Ok. Proceed then. Make a different .py file for the objects
@sauntheninja2 Hey I have added Postgres Database to the app. You can access the database using os.getenv('DATABASE_URL')
. On local system you have to set Environment variable DATABASE_URL to
postgres://hbadpcocmlhrpv:0479faf1070d0a31a66f179aaab53aec23bf9a4aa3e5c7e09e52126cc5847d32@ec2-54-146-142-58.compute-1.amazonaws.com:5432/d47ndu81md817c
Yes i wondering whether i have to create the database or not thanks
Last 5 days remaining for hacktoberfest to end although there is no deadline for you to send in PRs. Make your contribution ASAP if the issue is fixed @sauntheninja2
Description
Present version stores the conversations in the python application which gets deleted when the application is refreshed.
Proposed Solution
Local storage has to be used and conversations are to be stored in browser cookies so that they are preserved for the particular user involved in the conversation.
Alternatives Considered
In case the mentioned solution is not possible, the alternative can be storage of conversations in PostgreSQL database with a specific limit to account for database expense.