Ask coding questions

← Back to all posts
Database not saving
Xpym4uk

(Aio)Sqlite3 database resetting when the programm restarting.
I need to do it not resetting, because i making bot for telegram with value system. On repl.it on each restart bot resetting database to first state file. Please help :(

Voters
Xpym4uk
Comments
hotnewtop
OldWizard209

Why don't u use replit's database?

Xpym4uk

@OldWizard209 i need to use values by their owners, like "Select VALUE from OWNER". It needs to make for every user many single values

OldWizard209

Yeah, you can still use the replit database. But you can save a list as a value to the key, and access the elements from there.

And the reason why your database is resetting is everytime the code runs, you are creating a new connection to the db. Create a connection only if a db has not already been created. @Xpym4uk

Xpym4uk

@OldWizard209 Ok thanks

xfinnbar

@Xpym4uk You can also use MongoDB atlas, which allows more advanced queries.

Xpym4uk

@OldWizard209 no, not working. If i delete creating connection i cannot get/set/delete table values in database