Ask coding questions

← Back to all posts
How do you use the repl.it database outside repl.it?
jeanenchanted

I'm currently using the database for my Discord Bot, but it'd be nice if I could also access it outside of repl.it (eg. self-hosting on VS Code when testing, but still using the same data). Is this already possible? If so, how do I do it?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
jeanenchanted
Comments
hotnewtop
Coder100

It's called the replit database for a reason.

Even if you got the REPLIT_DB_URL, you suffer these consequences:

  • the db URL refreshes every so often for security, and maintaining that is a pain.

Try my JSON store db instead:
https://replit.com/talk/share/Easy-Web-Database/137962

IMayBeMe

Unfortunately I think it must be used within replit, maybe try using SQLite as it’s pretty simple and works outside replit

xfinnbar

Import the replitapi package and get your replit db URL by doing $REPLIT_DB_URL in the shell. Then set that URL as the environment variable "REPLIT_DB_URL" in your local system. You should now be able to use your database outside of replit!

VulcanWM

I think you can only use it in Replit