Ask coding questions

← Back to all posts
How do you use the database outside
jeanenchanted (21)

I'm currently using the database for my Discord Bot, but it'd be nice if I could also access it outside of (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 (18207) [earned 5 cycles]
View Answer
Coder100 (18207)

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:

IMayBeMe (484)

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

xfinnbar (83)

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 (2770)

I think you can only use it in Replit