doxr
June 6, 2023, 10:39pm
1
Hello everyone, I would like to know if there is any way I can use ReplitDB (JavaScript) without Replit itself (ex. on your own computer).
I know that you have to work with REPLIT_DB_URL
but how specifically? Can I get proper instructions on how to?
I am assuming you have to put a REPLIT_DB_URL in Client()
but I don’t know if that is the solution. Also, is there any way I can get a DB URL without the creation of a random repl?
2 Likes
Create a .env
file and put the following in it:
REPLIT_DB_URL="your-database-proxy-server.doxr.repl.co"
No, what I said above, nothing in Client()
.
Unfortunately no. Use this template to create your database proxy (it would be advisable for Always On on your proxy as well):
replit.com/@util/Replit-Database-proxy?v=1
3 Likes
doxr
June 6, 2023, 10:54pm
3
Trying now, but I think the database URL changes once in a while?
element1010:
Always On on your proxy
UptimeRobot?
Oh and I forgot, you have to run
pip install replit
in your command-line prompt.
No, it doesn’t, not if you create a proxy server.
doxr:
UptimeRobot?
If it works. I’ve heard reports of UptimeRobot not working on Repls.
1 Like
doxr
June 6, 2023, 10:56pm
6
element1010:
pip
Oh, no, I’m using JavaScript. I’ll assume that I can just use npm
.
Works for me
No wait sorry!
It has to be
npm install @replit/database
Sorry for the confusion
2 Likes
doxr
June 6, 2023, 10:59pm
9
Cool!
Also hopefully mods won’t get angry for this but what if I used something like SQLite, is it hard to switch to?
2 Likes
What do you mean by “switch to”?
2 Likes
doxr
June 6, 2023, 11:02pm
11
ex. change from
client.set("muted-users", muted);
to whatever sqlite uses without having to change the code (ex. sqlite is “client”)
1 Like
I don’t understand what you mean, but I don’t think it will be easy to switch as SQLite and ReplDB are two completely different things.
1 Like
doxr
June 6, 2023, 11:07pm
13
Guess I’ll have to stick to ReplitDB
I’m trying your solution, but Glitch is being a pain rn.
If I helped, please mark my post as solution!
doxr
June 6, 2023, 11:30pm
15
Cool, I’ll just mark you and try it later.
Both work actually, although if you use env
variables you need to make sure you configure env
.
2 Likes
system
Closed
June 13, 2023, 11:50pm
17
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.