Ask coding questions

← Back to all posts
New replit database? Cannot delete current.
bankey (0)

I added a couple of key/value pairs into my database in which some of the keys contained special characters, such as 'â' and I am unable to remove them via db.delete or db.empty() as they are throwing errors. I cannot list keys either as that also throws errors.

Answered by Coder100 (18139) [earned 5 cycles]
View Answer
Coder100 (18139)

some of the official clients have failed to handle this, and the only way to fix it is to fork the repl, so the db is reset.

bankey (0)

@Coder100 Perfect, thank you :)

Coder100 (18139)

yeah sorry
np :)
mark as correct answer?

also another way you could fix it is using ord() and chr() next time @bankey

Coder100 (18139)

they give you the integer of the char and give you the char from the integer so then you can have those custom characters technically @bankey

EpicGamer007 (1736)

Theres a pretty simple fix and that is to urlencode before putting in the db. For example in nodejs, you would do db.set("key", encodeURIComponent("valueâ")); then whenever you get back data, you decodeURIComponent((await db.get("key")))