3 ms·
Congrats on the launch! Very small thing, but I didn't initially see the database icon in the sidebar. Trying to `from replit import db` in Python and using the
by gregsadetsky 6y ago
Congrats on the launch! Very small thing, but I didn't initially see the database icon in the sidebar. Trying to `from replit import db` in Python and using the `db` resulted in an unclear error message about the REPLIT_DB_URL missing ("are we running on repl.it?")
Turns out I had to sign in to repl.it for the sidebar icon to appear and the code to work.
The documentation (and that error message) might need to reflect this? And/or should databases be available to all users (i.e., those who aren't signed in as well)?
---
Another issue: when going to https://repl.it/repls/HandyNiceBug https://repl.it/repls/HandyNiceBug (providential URL...) ;-) even when signed in, running the code shows the same `REPLIT_DB_URL does not exist` error. If you click the database sidebar icon and any of the 'Insert ->' buttons, then the env seems to update and the code runs successfully.
---
Hopefully useful nitpick: after clicking the 'Insert ->' button once in the db sidebar UI (in the url above), all of the 'Insert ->' buttons stop working.
Aaaand, if I try manually copying any of the code snippets to insert one myself, what's copied into the clipboard is not-the-best. Instead of copying `db["key"] = "value"` for instance, it copies it but with many extra new lines and some bits missing. Might be useful to have a copy-to-clipboard icon? Or do some DOM trickery to allow selection/copy&paste?
Cheers :-)
- kochman 6y agoGood points, you're right: you have to be signed in for Database to work. We'll make this clearer. We'll also fix the code snippet copying. Thank you for giving it a try!
- vhbit 6y agoon Golang REPL there is no error message displayed which makes it even more puzzling, thanks for hint with logging in!