K
K
keshamin2017-04-27 16:09:44
Python
keshamin, 2017-04-27 16:09:44

How to work with a database in Heroku?

As the question suggests, I'm still new to programming.
I made a simple telegram bot and posted it on heroku.
In order for the bot to store data about the user, he taught him, using sqlite3, to connect to the database (or create one if there is none) and operate on the data in it.
The problem is that after the heroku puts the bot to sleep, upon waking up, no database is already in the application directory.
Can you tell me how to make it permanent?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Romanov, 2017-04-28
@keshamin

No way, sqlite works with an embedded database (in a file). And the files on Heroku are temporary. Use postgres

S
slepowl, 2017-04-28
@slepowl

https://www.mongodb.com/scale/mongodb-hosting-free
https://www.mlab.com/plans/pricing/#plan-type=sandbox
I used mlab for my bot. If Nosql is not an option, check out free hosting for sql.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question